~starkingdoms/starkingdoms

189aaf53b54757d739dbf6943b14aa74ca61e438 — TerraMaster85 1 year, 11 months ago 61dba6e
Newer & better pre-commit hook (.git-hooks)
1 files changed, 2 insertions(+), 13 deletions(-)

M .git-hooks/pre-commit
M .git-hooks/pre-commit => .git-hooks/pre-commit +2 -13
@@ 1,14 1,3 @@
#!/bin/bash
echo "Checking your formatting..."
rustfmt server/src/*.rs --edition 2021 --check
if [ $? -ne 0 ]; then
  echo "Uh oh, looks like your formatting is off! Run 'rustfmt server/src/*.rs --edition 2021' to fix it."
  exit 1
fi
cd starkingdoms-client && yarn prettier . --check
if [ $? -ne 0 ]; then
  echo "Uh oh, looks like your formatting is off! Run 'cd starkingdoms-client && yarn prettier . --write' to fix it."
  exit 1
fi
echo "Everything looks good! Proceeding with commit..."
exit 0
cargo fmt
cd starkingdoms-client && yarn prettier . --write