aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/serve.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-08-09 19:58:20 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-08-09 19:58:20 +0300
commit60dd7f7dbba45d1c48b6ed6e5b6c00e711936992 (patch)
tree9f25cc5f8e4bcaf7f158e31ac4d262142e0e37c8 /serve.sh
parentbump dependencies (diff)
downloadegor-tensin.github.io-60dd7f7dbba45d1c48b6ed6e5b6c00e711936992.tar.gz
egor-tensin.github.io-60dd7f7dbba45d1c48b6ed6e5b6c00e711936992.zip
serve.sh: add destination directory parameter
Diffstat (limited to '')
-rwxr-xr-xserve.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/serve.sh b/serve.sh
index bc5c09d..a1af8d7 100755
--- a/serve.sh
+++ b/serve.sh
@@ -1,3 +1,22 @@
-#!/bin/sh
+#!/usr/bin/env bash
-bundle exec jekyll serve --watch --force_polling --host 0.0.0.0 --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}"} \
+ --force_polling \
+ --host 0.0.0.0 \
+ --watch