Skip to content

Commit 52e6f21

Browse files
committed
Add filecheck script to check for essential files
Check for presence of `description.md` and `metadata.yml`. Add this script to travis build. Fixes #457
1 parent c59c2c4 commit 52e6f21

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ addons:
99

1010
script:
1111
- bin/jsonlint
12+
- bin/filecheck

bin/filecheck

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
FILES=(description.md metadata.yml)
4+
5+
function error_exit {
6+
printf "$1" >&2
7+
exit "${2:-1}"
8+
}
9+
10+
11+
for dir in $(ls exercises); do
12+
for file in ${FILES[@]}; do
13+
if [ ! -f exercises/$dir/$file ]; then
14+
error_exit "\n[Error] Missing file: exercises/$dir/$file\n"
15+
fi
16+
printf "." # show progress
17+
done
18+
done
19+
printf "\n"

0 commit comments

Comments
 (0)