diff options
author | Hussein A <44173825+haitlahcen@users.noreply.github.com> | 2018-11-20 16:44:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 16:44:40 +0100 |
commit | 5485dbc4db3e141673457475bcda5fc88057739f (patch) | |
tree | da805be5a35221b8818581b404048999363b7291 /scripts | |
parent | b570ba036adb74095c712705d686f630d41f4ed0 (diff) | |
parent | d1f83c592b92a68f7f968eac0323ee7d7fd0ee47 (diff) | |
download | ansible-clever-5485dbc4db3e141673457475bcda5fc88057739f.tar.gz ansible-clever-5485dbc4db3e141673457475bcda5fc88057739f.tar.zst ansible-clever-5485dbc4db3e141673457475bcda5fc88057739f.zip |
Merge pull request #18 from haitlahcen/dhall-interfacev1.9
add dhall interface
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dhall_check.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/dhall_check.sh b/scripts/dhall_check.sh new file mode 100755 index 0000000..a3413ec --- /dev/null +++ b/scripts/dhall_check.sh | |||
@@ -0,0 +1,26 @@ | |||
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 | echo "Typechecking ${file}" | ||
17 | if [ "$?" -ne "0" ]; then | ||
18 | echo "Failed to resolve $file" | ||
19 | ERROR=1; | ||
20 | fi; | ||
21 | popd; | ||
22 | done; | ||
23 | exit $ERROR; | ||
24 | } | ||
25 | |||
26 | go | ||