Skip to content

Commit

Permalink
Switch to script-based git status modified check
Browse files Browse the repository at this point in the history
  • Loading branch information
bskinn committed Mar 29, 2024
1 parent c614093 commit 088f3ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: npm run format

- name: Check for dirty working tree
run: git diff | grep -q 'modified' && exit 1 || exit 0
run: scripts/check-dirty-tree.sh
19 changes: 19 additions & 0 deletions scripts/check-dirty-tree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash

#####################################################################
# Per https://sharats.me/posts/shell-script-best-practices/ (partial)
set -o errexit
set -o nounset
set -o pipefail

if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
#####################################################################

git status | grep modified:

if [ $? = 0 ]
then
exit 1
fi

0 comments on commit 088f3ee

Please sign in to comment.