blog-rekahsoft-ca/site
Collin J. Doering 026237b911 Wrap site tool to allow testing option
Instead of having a symbolic link from ./site to the executable in
dist/build/blog-rekahsoft-ca/blog-rekahsoft-ca, a separate test
running script ./site-test and a Makefile (which is redundant), have a
single shell script that wraps the blog-rekahsoft-ca executable and adds
a test option along with a switch to start selenium (-s|--run-selenium).

Updated README accordingly and removed unnecessary Makefile, and
site-test. Moved the symbolic link ./site to ./%site.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-07-11 03:11:48 -04:00

24 lines
607 B
Bash
Executable File

#!/bin/bash
if [ "$1" == "test" ]; then
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
# Remove empty files under directory _site
echo "Removing empty files..."
find _site -type f -empty -exec rm -v {} \;
# Test site
cabal test --show-details=always --test-option=--color
else
exec "./%site" "$@"
fi