diff options
author | Hussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com> | 2018-11-19 15:50:51 +0100 |
---|---|---|
committer | Hussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com> | 2018-11-19 18:58:43 +0100 |
commit | 50a9e710f9cff8be9d85d7161bb454a46c3f5734 (patch) | |
tree | 8b566d127eb719a0c3f458f8f80b91a6d75040bc /scripts/dhall_check.sh | |
parent | b570ba036adb74095c712705d686f630d41f4ed0 (diff) | |
download | ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.tar.gz ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.tar.zst ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.zip |
add dhall interface
Diffstat (limited to 'scripts/dhall_check.sh')
-rwxr-xr-x | scripts/dhall_check.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/dhall_check.sh b/scripts/dhall_check.sh new file mode 100755 index 0000000..009d570 --- /dev/null +++ b/scripts/dhall_check.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | pushd () { | ||
4 | command pushd "$@" > /dev/null | ||
5 | } | ||
6 | |||
7 | popd () { | ||
8 | command popd "$@" > /dev/null | ||
9 | } | ||
10 | |||
11 | go() { | ||
12 | local ERROR=0; | ||
13 | for file in $(find -type f -name "*.dhall"); do | ||
14 | pushd $(dirname $file); | ||
15 | cat $(basename $file) | dhall --explain resolve > /dev/null; | ||
16 | if [ "$?" -ne "0" ]; then | ||
17 | echo "Failed to resolve $file" | ||
18 | ERROR=1; | ||
19 | fi; | ||
20 | popd; | ||
21 | done; | ||
22 | exit $ERROR; | ||
23 | } | ||
24 | |||
25 | go | ||