aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-08-09 19:44:19 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-08-09 19:45:26 +0300
commit5574eb7955c19246c74302eb89b38a0a15d172c6 (patch)
treefb6efc0b50b987cc7547a9a5fdafac90a4cf7d8c
parentbump dependencies (diff)
downloadsorting-algorithms-5574eb7955c19246c74302eb89b38a0a15d172c6.tar.gz
sorting-algorithms-5574eb7955c19246c74302eb89b38a0a15d172c6.zip
serve.sh: add destination directory parameter
-rw-r--r--serve.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/serve.sh b/serve.sh
index d9f5b5a..933f365 100644
--- a/serve.sh
+++ b/serve.sh
@@ -1,3 +1,23 @@
-#!/bin/sh
+#!/usr/bin/env bash
-bundle exec jekyll serve --watch --force_polling --host 0.0.0.0 --drafts --config _config.yml,_config_dev.yml
+set -o errexit -o nounset -o pipefail
+
+script_name="$( basename -- "${BASH_SOURCE[0]}" )"
+
+case "$#" in
+ 0) ;;
+ 1)
+ dest_dir="$1"
+ ;;
+ *)
+ echo "usage: $script_name [DEST_DIR]" >&2
+ exit 1
+esac
+
+bundle exec jekyll serve \
+ --config _config.yml,_config_dev.yml \
+ ${dest_dir+--destination "${dest_dir}"} \
+ --drafts \
+ --force_polling \
+ --host 0.0.0.0 \
+ --watch