script/default-site: accept flags for jekyll new#9259
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.
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 buildjekyll 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-sitetoscript/blank-siteso that we could runjekyll new --blankthenjekyll buildthe way thatscript/default-sitedoes. 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 --blankto 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).