From bf8d50ee085be56fde9f1f5fbebc406496f1b120 Mon Sep 17 00:00:00 2001 From: Parker Moore <237985+parkr@users.noreply.github.com> Date: Wed, 18 Jan 2023 23:05:39 -0800 Subject: [PATCH] script/default-site: accept flags for `jekyll new` (#9259) Merge pull request 9259 --- script/default-site | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/default-site b/script/default-site index 0504fd38..7f56c908 100755 --- a/script/default-site +++ b/script/default-site @@ -1,15 +1,18 @@ #!/usr/bin/env bash # Runs the `jekyll new` command and builds the default site as a sanity check +# Additional flags for `jekyll new` may be passed to this script. set -e +TMP_SOURCE="tmp/default-site" + echo "$0: setting up tmp directory" mkdir -p ./tmp -rm -Rf ./tmp/default-site +rm -Rf "./$TMP_SOURCE" echo "$0: creating new default site" -bundle exec jekyll new tmp/default-site -pushd tmp/default-site +bundle exec jekyll new "$TMP_SOURCE" "$@" +pushd "$TMP_SOURCE" echo "$0: respecifying the jekyll install location" ruby -e "contents = File.read('Gemfile'); File.write('Gemfile', contents.sub(/gem \"jekyll\".*\\n/, 'gem \"jekyll\", path: \"../../\"'))"