Skip to content

Commit 758a645

Browse files
committed
Fix path
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent e21a84a commit 758a645

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/precommit_lint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ TMP="$(mktemp -d)"
77
clean() { rm -rf "$TMP"; }
88
trap clean EXIT
99

10-
git -C "$TMP" init
10+
ROOT="$(dirname "$(dirname "$(pwd)")")"
1111

1212
cat << EOF > "$TMP/.pre-commit-config.yaml"
1313
repos:
14-
- repo: $(dirname "$(dirname "$(pwd)")")
14+
- repo: $ROOT
1515
rev: HEAD
1616
hooks:
1717
- id: sourcemeta-jsonschema-lint
@@ -25,11 +25,14 @@ cat << 'EOF' > "$TMP/schema.json"
2525
}
2626
EOF
2727

28+
git -C "$TMP" init
2829
git -C "$TMP" add .
2930

3031
cd "$TMP"
3132
pre-commit install
32-
pre-commit run --files schema.json > "$TMP/out.txt" 2>&1 && CODE="$?" || CODE="$?"
33+
PATH="$ROOT/bin:$PATH" \
34+
pre-commit run --files schema.json > "$TMP/out.txt" 2>&1 \
35+
&& CODE="$?" || CODE="$?"
3336
cat "$TMP/out.txt"
3437
test "$CODE" = "1" || exit 1
3538
grep -q "enum_with_type" "$TMP/out.txt" || exit 1

0 commit comments

Comments
 (0)