Skip to content

Commit 26a9259

Browse files
committed
Fix terraform-validate hook
1 parent 6b5c74c commit 26a9259

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

hooks/adoclink-check.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# OSX GUI apps do not pick up environment variables the same way as Terminal apps and there are no easy solutions,
6+
# especially as Apple changes the GUI app behavior every release (see https://stackoverflow.com/q/135688/483528). As a
7+
# workaround to allow GitHub Desktop to work, add this (hopefully harmless) setting here.
8+
export PATH=$PATH:/usr/local/bin
9+
10+
if ! command -v asciidoc-link-check; then
11+
>&2 echo "asciidoc-link-check is not available on this system."
12+
>&2 echo "Please install it by running 'npm install -g asciidoc-link-check'"
13+
exit 1
14+
fi
15+
16+
for file in "$@"; do
17+
asciidoc-link-check "$file"
18+
done

hooks/terraform-validate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export PATH=$PATH:/usr/local/bin
99

1010
for dir in $(echo "$@" | xargs -n1 dirname | sort -u | uniq); do
1111
pushd "$dir" >/dev/null
12-
terraform init -backend=false "$dir"
13-
terraform validate "$dir"
12+
terraform init -backend=false
13+
terraform validate
1414
popd >/dev/null
1515
done

0 commit comments

Comments
 (0)