Skip to content

Commit 6e64da4

Browse files
committed
Set pwd for precommit to support run it in any directory
1 parent b1debf0 commit 6e64da4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/precommit.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh
1+
REPO_ROOT=$(dirname $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ))
2+
3+
pushd "${REPO_ROOT}" > /dev/null
4+
5+
cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh
6+
7+
popd > /dev/null

0 commit comments

Comments
 (0)