-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Want to prevent any invalid UUIDs from being entered. Want to put this in configlet lint, but can't: exercism/configlet#99 exercism/configlet#168 So it will go in individual tracks' .travis.yml for now. It appears that the site will accept pretty much arbitrary strings as UUIDs for now, but we want to make less work for ourselves when valid UUIDs are required.
- Loading branch information
1 parent
62a872c
commit e79e43f
Showing
2 changed files
with
14 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
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,13 @@ | ||
#!/bin/sh | ||
|
||
repo=$(cd "$(dirname "$0")/.." && pwd) | ||
|
||
# Check for invalid UUIDs. | ||
# can be removed once `configlet lint` gains this ability. | ||
# Check issue https://github.com/exercism/configlet/issues/99 | ||
bad_uuid=$(jq --raw-output '.exercises | map(.uuid) | .[]' $repo/config.json | grep -vE '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$') | ||
if [ -n "$bad_uuid" ]; then | ||
echo "invalid UUIDs found! please correct these to be valid UUIDs:" | ||
echo "$bad_uuid" | ||
exit 1 | ||
fi |