chore: Clean up usage of git commands in git hooks.

This commit is contained in:
greysoh 2024-06-02 11:24:53 -04:00
parent a5381d0e25
commit 436811a0e3
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37

View file

@ -2,16 +2,17 @@
shopt -s globstar
set -e
pushd $(git rev-parse --show-toplevel)/api
ROOT="$(git rev-parse --show-toplevel)"
pushd $ROOT/api
npx eslint src
popd
pushd $(git rev-parse --show-toplevel)/lom
pushd $ROOT/lom
npx eslint src
popd
# Formatting step
"$(git rev-parse --show-toplevel)"/api/node_modules/.bin/prettier --ignore-unknown --write $(git rev-parse --show-toplevel)/{api,lom}/{eslint.config.js,src/**/*.ts}
rustfmt $(git rev-parse --show-toplevel)/gui/src/**/*.rs
$ROOT/api/node_modules/.bin/prettier --ignore-unknown --write $ROOT/{api,lom}/{eslint.config.js,src/**/*.ts}
git update-index --again
exit 0