use long forms of flags in pre-commit hook script

master
Conduitry 1 year ago
parent 30f4fd0a29
commit 4c8f1f8014
  1. 8
      .githooks/pre-commit

@ -1,8 +1,8 @@
#!/bin/sh
git diff --quiet --cached -- scripts && exit 0
git diff --name-only -- scripts | grep -F "$(git diff --cached --name-only -- scripts)" && exit 1
version="$(date -u +%Y.%m.%d.%H%M%S)"
git diff --cached --quiet -- scripts && exit 0
git diff --name-only -- scripts | grep --fixed-strings "$(git diff --cached --name-only -- scripts)" && exit 1
version="$(date --utc +%Y.%m.%d.%H%M%S)"
git diff --cached --name-only -- scripts | while read -r file; do
sed -i "s/@version .*/@version $version/" "$file"
sed --in-place "s/@version .*/@version $version/" "$file"
git add "$file"
done

Loading…
Cancel
Save