aboutsummaryrefslogblamecommitdiffhomepage
path: root/scripts/dhall_check.sh
blob: 5a1ee1bd244553a8f1661c738642836d3b4c31d5 (plain) (tree)
1
2
3
4
5
6
7
8
9

                   
                

      



                                   
                               
                                                                         
                                    
             
       

                                                    



              
#!/usr/bin/env bash

set -eo pipefail

go() {
  local ERROR=0
  while IFS= read -r -d '' file
  do
    cd "$(dirname "$file")" || exit
    echo "Typechecking ${file}"
    if ! dhall --explain resolve < "$(basename "$file")" >/dev/null; then
      echo "Failed to resolve $file"
      ERROR=1
    fi;
    cd - >/dev/null || exit
  done <   <(find . -type f -name "*.dhall" -print0)
  exit $ERROR;
}

go