Skip to content

Commit

Permalink
Set pwd for precommit.sh script to support running it in any directory (
Browse files Browse the repository at this point in the history
#2535)

Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
  • Loading branch information
3 people authored Feb 7, 2025
1 parent eeb367d commit 34742d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ Open a pull request against the main
repo.

> **Note**
> It is recommended to run [pre-commit script](scripts/precommit.sh) from the root of
the repo to catch any issues locally.
> It is recommended to run [pre-commit script](scripts/precommit.sh) to catch any issues locally.
### How to Receive Comments

Expand Down
8 changes: 7 additions & 1 deletion scripts/precommit.sh
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh
REPO_ROOT=$(dirname $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ))

pushd "${REPO_ROOT}" > /dev/null

cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh

popd > /dev/null

0 comments on commit 34742d0

Please sign in to comment.