diff options
author | Gaƫtan <36162164+gaetanfl@users.noreply.github.com> | 2018-11-20 20:32:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 20:32:43 +0100 |
commit | 66401fc939cd73628561d4832c3e219f0b44d8de (patch) | |
tree | ca5b2bc2ea4c15d91476436ca4376108f5a78d88 /scripts | |
parent | 6bbc5a167fb43110a5b16746c112298f392be2b8 (diff) | |
parent | 77e27a11c31fee82c2ff30613bc832f5171fa845 (diff) | |
download | ansible-kong-app-66401fc939cd73628561d4832c3e219f0b44d8de.tar.gz ansible-kong-app-66401fc939cd73628561d4832c3e219f0b44d8de.tar.zst ansible-kong-app-66401fc939cd73628561d4832c3e219f0b44d8de.zip |
Merge pull request #7 from haitlahcen/dhall-interfacev0.5
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..6fc7fd1 --- /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 "Type checking ${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 | ||