File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,24 @@ test_dependencies() {
2525 test_dep " sha256sum"
2626 test_dep " jq"
2727 test_dep " xargs"
28+ test_dep " find"
29+ }
30+
31+ test_repository_structure () {
32+ cd " ${ROOTDIR} "
33+ if [ ! -d " Repository" ]; then
34+ print_clr ${ERROR} " Repository is missing expected 'Repository' folder"
35+ exit 104
36+ fi
37+ while read LINE; do
38+ if ! [[ " $LINE " =~ ^Repository/[0-9]([.][0-9]){3}(/[^/]+){2}/[^/]+json$ ]]; then
39+ error=$?
40+ print_clr ${ERROR} " FAIL: Invalid path ${LINE} "
41+ fi
42+ done < <( find Repository/ -iname ' *.json' -type f)
43+
44+ [ ! -z " $error " ] && exit $error
45+ print_clr ${SUCCESS} " SUCCESS: Repository directory structure"
2846}
2947
3048check_sha256 () {
@@ -53,6 +71,7 @@ validate() {
5371}
5472
5573test_dependencies
74+ test_repository_structure
5675
5776for file in ${ROOTDIR} /** ; do
5877 [ " ${file: -5} " == " .json" ] && validate " ${file} "
You can’t perform that action at this time.
0 commit comments