-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
script/default-site: accept flags for jekyll new
#9259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hmmm.. I'm really not able to wrap my head around the current diff. (Your idea is sound. But the implementation is sketchy.)
I agree with this thought. |
script/default-site
Outdated
|
||
echo "$0: creating new default site" | ||
bundle exec jekyll new tmp/default-site | ||
pushd tmp/default-site | ||
bundle exec jekyll new "$TMP_SOURCE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New "$@" should be here - sorry for the confusion @ashmaroli!
Yeah, I was thinking that we'd invoke this twice and it'd be nice to not blow away the first one, but I can revert if you prefer! Let me know. |
If we are indeed continuing down the "Bash script" route (as against the "Cucumber test" route), I feel we can address your primary concern (about duplicated code) using just "Bash functions" to respect DRY and the secondary concern (about keeping directories separate and untouched) by exposing
Update: I wasn't thinking straight. The above script isn't gonna work. Besides, dirname as PID hampers readability of both build log and file system tree itself. |
jekyll build
jekyll new
Updated to remove the PID-specific dir. In general I’m trying to simplify, so adding another file with bash functions doesn’t feel like it simplifies. |
Thanks @parkr |
Parker Moore: script/default-site: accept flags for `jekyll new` (#9259) Merge pull request 9259
This is a 🔨 code refactoring.
Summary
In #9257, @ashmaroli proposed copying
script/default-site
toscript/blank-site
so that we could runjekyll new --blank
thenjekyll build
the way thatscript/default-site
does. I was hesitant to duplicate much of the script into another script, so I was thinking that maybe we could make the common components a single script.With this, you can
script/default-site --blank
to runjekyll new --blank
. It still runs the smoke test that says "does a blank site build".The best outcome would probably be a Cucumber test which is already setup to do roughly this kind of operation (create a site, then run jekyll build, and verify that it built the expected output).