diff --git a/%site b/%site deleted file mode 120000 index a7c0769..0000000 --- a/%site +++ /dev/null @@ -1 +0,0 @@ -dist/build/blog-rekahsoft-ca/blog-rekahsoft-ca \ No newline at end of file diff --git a/site b/site index 042fb8f..6364bca 100755 --- a/site +++ b/site @@ -1,23 +1,37 @@ #!/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 +CABAL="/usr/bin/cabal" +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 - 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 + # Test site + $CABAL $TEST_SITE + ;; + clear) + $CABAL clean + ;; + configure) + $CABAL $CONFIGURE_SITE + ;; + make) + $CABAL $BUILD_SITE + ;; + *) + $CABAL $RUN_SITE "--" "$@" + ;; +esac diff --git a/src/site.hs b/src/site.hs index b2a3123..25845d1 100644 --- a/src/site.hs +++ b/src/site.hs @@ -91,9 +91,7 @@ pandocWriterOptions = defaultHakyllWriterOptions myConfig :: Configuration myConfig = defaultConfiguration - { deployCommand = "echo 'Removing empty files...' && " ++ - "find _site -type f -empty -exec rm -v {} \\; && " ++ - "echo '\nDeploying website...' && " ++ + { deployCommand = "echo '\nDeploying website...' && " ++ "rsync -rpogtzcv --delete -e ssh _site/ collin@rekahsoft.ca:~/public_html/blog/" , previewPort = 3000 }