From 77e27a11c31fee82c2ff30613bc832f5171fa845 Mon Sep 17 00:00:00 2001 From: Hussein Ait-Lahcen Date: Mon, 19 Nov 2018 15:51:21 +0100 Subject: add dhall interface --- scripts/dhall_check.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/dhall_check.sh (limited to 'scripts') 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 @@ +#!/usr/bin/env bash + +pushd () { + command pushd "$@" > /dev/null +} + +popd () { + command popd "$@" > /dev/null +} + +go() { + local ERROR=0; + for file in $(find -type f -name "*.dhall"); do + pushd $(dirname $file); + cat $(basename $file) | dhall --explain resolve > /dev/null; + echo "Type checking ${file}" + if [ "$?" -ne "0" ]; then + echo "Failed to resolve $file" + ERROR=1; + fi; + popd; + done; + exit $ERROR; +} + +go -- cgit v1.2.3