#!/bin/bash BIN=bin function setup_external_tools { if [ ! -f "$BIN/test-runner" ] then mkdir -p "$BIN" cabal v2-install --symlink-bindir="$BIN" test-lib fi } function show_usage { cat <> src/GitRev.hs cabal v2-build exe:cryptol # WARNING!!!: this is here to undo the HACK date stamp, and will # undo any changes to this file, so comment it out if you'd like # to change the file git checkout src/GitRev.hs ;; haddock) echo Building Haddock documentation cabal v2-haddock;; test) echo Running tests setup_external_tools if [ "$#" == "0" ] then TESTS=tests else TESTS=$* fi $BIN/test-runner --ext=.icry \ --exe=cabal \ -F v2-run -F -v0 -F exe:cryptol -F -- -F -b \ $TESTS ;; help) show_usage exit 0;; exe-path) cabal v2-run exe:cryptol --verbose -- -c ':q' | grep :q | awk '{ print $1 }' exit 0;; *) echo Unrecognized command: $COMMAND show_usage exit 1;; esac