Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoyt Koepke committed Jun 28, 2024
1 parent 5471ee0 commit f80b2ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/precommit-hook
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/sh

base_dir="${PWD}"

# Find all subdirectories containing a Cargo.toml file
for d in * ; do
if [[ ! -e "$d/Cargo.toml" ]] ; then
continue
fi

cd "$base_dir"

echo "Formatting and updated $d"

pushd $d
cd $d

# Run cargo fmt
if ! cargo fmt > /dev/null 2>&1; then
Expand All @@ -20,7 +22,6 @@ for d in * ; do
echo "cargo generate-lockfile failed in $(pwd)" >&2
fi

popd $d
done

# Always return true to allow the commit to proceed
Expand Down

0 comments on commit f80b2ae

Please sign in to comment.