From 3073877d105c4c10af26b104389f8ab721fe32e4 Mon Sep 17 00:00:00 2001 From: Thanat0s Date: Sun, 26 Feb 2017 03:16:41 +0100 Subject: [PATCH] block by default, but usable anyway with param --- validate_all.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/validate_all.sh b/validate_all.sh index 455c64d..31f47d7 100755 --- a/validate_all.sh +++ b/validate_all.sh @@ -1,5 +1,11 @@ #!/bin/bash +# This file launch all validation of the jsons and schemas +# By default, It stop on file not commited. + +# you could test with command ./validate_all.sh something + + # Check Jsons format, and beautify ./jq_all_the_things.sh rc=$? @@ -10,14 +16,13 @@ fi set -e set -x -# fixme to remove.. -# Not need anymore ow, jq stop upon error... -# diffs=`git status --porcelain | wc -l` -# -#if ! [ $diffs -eq 0 ]; then -# echo "Please make sure you run ./jq_all_the_things.sh before commiting." -# exit -#fi +diffs=`git status --porcelain | wc -l` +if ! [ $diffs -eq 0 ]; then + echo "Please make sure you run ./jq_all_the_things.sh before commiting." + if [ $# -eq 0 ]; then + exit 1 + fi +fi # Validate schemas for dir in clusters/*.json