#!/bin/bash CONFIGURE_SITE="configure --enable-tests" BUILD_SITE="build" RUN_SITE="run --verbose=0 blog-rekahsoft-ca" TEST_SITE="test --show-details=always --test-option=--color" case "$1" in test) if [ "$2" == "-s" ] || [ "$2" == "--run-selenium" ]; then if ! type selenium &> /dev/null; then echo "Failed to run Selenium. It must not be installed or not accessible on \$PATH!" exit 1 fi echo "Running Selenium..." selenium 2> /dev/null & sleep 3s fi # Test site cabal $TEST_SITE ;; clear) cabal clean ;; configure) cabal $CONFIGURE_SITE ;; make) cabal $BUILD_SITE ;; init-env) shift ./init-env.sh "$@" ;; *) cabal $RUN_SITE "--" "$@" ;; esac