diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-08-09 20:07:01 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-08-09 20:07:01 +0300 |
commit | c533b5884ddc73b141d16f589e690ea94309ee25 (patch) | |
tree | 12cbef7c67849fa1fb0edb9a605adfbbdb022f19 | |
parent | bump dependencies (diff) | |
download | blog-c533b5884ddc73b141d16f589e690ea94309ee25.tar.gz blog-c533b5884ddc73b141d16f589e690ea94309ee25.zip |
serve.sh: add destination directory parameter
-rwxr-xr-x | serve.sh | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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 |