-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(lint): adding pre-commit hook for checking chalk version across …
…files (#41) this will check chalk version matches across various files. currently we only check: * nimble file * base_keyspecs.c4m If the chalk version is updated in nimble file, all other files need to match it.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
set -eEu | ||
set -o pipefail | ||
|
||
FILEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "$FILEDIR" 1> /dev/null 2>&1 | ||
|
||
# cd to root of the repo | ||
cd .. | ||
|
||
KEYSPEC=src/configs/base_keyspecs.c4m | ||
current_version=$(make version) | ||
keyspec_version=$( | ||
grep -E "chalk_version\s:=" $KEYSPEC \ | ||
| cut -d'"' -f2 | ||
) | ||
|
||
if [ "$current_version" != "$keyspec_version" ]; then | ||
echo $KEYSPEC chalk_version does not match nimble chalk version | ||
echo "$keyspec_version != $current_version" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters