Skip to content

Commit a535c10

Browse files
authored
Silence annoying ltex error on no error (#5)
1 parent f5141fb commit a535c10

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ repos:
44
- id: check-hooks-apply
55
- id: check-useless-excludes
66

7+
- repo: https://github.com/shellcheck-py/shellcheck-py
8+
rev: v0.10.0.1
9+
hooks:
10+
- id: shellcheck
11+
args: [-x]
12+
713
- repo: local
814
hooks:
915
- id: local_hooks

ltex/ltex.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ set -euo pipefail
77
ltex_dir=$(dirname "$0")
88
ltex_version=""
99

10-
ltex_tag=$(cd $ltex_dir; tar -cf - ./ | md5sum | cut -d' ' -f1)
10+
ltex_tag=$(cd "$ltex_dir"; tar -cf - ./ | md5sum | cut -d' ' -f1)
1111
ltex_version="ltex:$ltex_tag"
1212

1313
(
14-
cd $ltex_dir
15-
docker inspect "$ltex_version" > /dev/null || docker build . -t "$ltex_version" -t 'ltex:latest'
14+
cd "$ltex_dir"
15+
docker inspect "$ltex_version" &>/dev/null || docker build . -t "$ltex_version" -t 'ltex:latest' > /dev/null
1616
)
1717

1818
files_to_clean=()
@@ -38,13 +38,15 @@ for file in "$@"; do
3838
fi
3939
done
4040

41-
echo "${files_to_process[@]}" |
41+
output=$(echo "${files_to_process[@]}" |
4242
xargs docker run --rm -i \
4343
--user "$UID" \
4444
--volume "$(pwd):/src:rw,Z" \
4545
--workdir /src \
46-
"$ltex_version" |
47-
sed -E 's|(app/javascript/documentation/.*?\.md):|\1x:|g' || true
46+
"$ltex_version" 2>&1 |
47+
sed -E 's|(app/javascript/documentation/.*?\.md):|\1x:|g' || true)
48+
49+
echo "$output" | grep "SEVERE: java.io.IOException: Stream closed" >/dev/null || echo "$output"
4850

4951
cleanup
5052

0 commit comments

Comments
 (0)