]> git.immae.eu Git - github/fretlink/ansible-clever.git/blob - scripts/dhall_check.sh
add dhall interface
[github/fretlink/ansible-clever.git] / scripts / dhall_check.sh
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