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
Add bundle install to jekyll new command #5237
Conversation
|
||
def bundle_install(path) | ||
Jekyll::External.require_with_graceful_fail "bundler" | ||
$stdout.print "\nRun 'bundle install' with default theme? (Y/N) " |
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.
Please use the Jekyll Logger.
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.
Jekyll logger inserts a newline at the end.. I proposed print to have gets on same line.
Is that fine?
4e58e89
to
a244819
Compare
Add bundler as a runtime dependency to gemspec? |
I don't think that's a good idea, that could lead to problems on a system. |
Thanks for this PR! I'm not sure how I feel about this either. The current code is interactive, which I'm not such a big fan of. In general, we are headed in the direction of "always use bundler" so this isn't problematic from that perspective. But we should gracefully fail if bundler isn't available and mention that the user should run |
Hi @parkr, I'm pretty confused..
PR does that already..
?? |
I'm 👍 with the idea of running bundler when you create a new Jekyll site. Let's just run it all the time though, instead of asking the user if we should run it. I see no use case where a user would not want to run bundler after getting a new site. |
@mattr- Thanks for the +1. 😃
I mentioned a possible scenario in the PR desc.: |
Those are technical use cases that I don't want to solve for, especially the directory inspection. While I expect that a large set of Jekyll's users are going to be on the more technical side, it's ridiculously easy to run |
Okay. I'll modify the PR. |
I'd prefer the simple option of an argument |
e4ea8a9
to
5d483a7
Compare
Replaced interactive bundle with running |
Jekyll.logger.info "Running bundle install in #{path.cyan}..." | ||
Dir.chdir(path) do | ||
unless ENV["CI"] || ENV["TEST"] # skip `bundle` during local tests | ||
system("bundle install") |
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.
I'd like to skip bundle install
when running tests. Couldn't find the appropriate ENV key/value..
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.
I don't know about all that but that should be system("bundle", "install")
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.
Meh, actually, tbh, it doesn't matter. I mix the two anyways I wouldn't blame you if you don't care to change it either.
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.
Doesn't really matter until you start passing arguments dynamically 😉 Although I do prefer the variadic argument form
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.
it works.. so leaving it as is..
Thanks for the info, anyways 😃
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.
@spudowiar it's that kind of terrible logic that leads to security issues in software. It always matters. Whether it works or not is irrelevant to the point, the statement stands and the option was left to leave it as is out of ease, not out of it "not mattering."
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.
@envygeeks I'm saying that although you should always use the variadic form, in this case not changing it doesn't matter too much. I always use the variadic form
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.
I would prefer system("bundle", "install")
as well. You may also have to specify the BUNDLER_GEMFILE
variable as well.
- automatically run `bundle install` from within the newly generated blog directory by default. - add a new switch to skip this default behaviour.
5d483a7
to
35ff8a9
Compare
35ff8a9
to
345f043
Compare
@jekyll/ecosystem : Since, this PR adds bundle install by default, should |
Updates:
|
|
||
def after_install(path, options = {}) | ||
Jekyll.logger.info "New jekyll site installed in #{path.cyan}." | ||
Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"] |
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.
Seems superfluous since --skip-bundle
is an explicitly chosen command line option, unaffected by the environment in any way
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.
👍
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.
This LGTM. Would love another review from someone in @jekyll/core or @benbalter.
LGTM. |
@jekyllbot: merge +minor |
TODO:
/cc @DirtyF |
@parkr et al, All those bundle (show) reports in test logs might get frustrating at some point in future.. |
Yeah definitely. If you can capture those and output them using |
@ashmaroli yeah, homepage snippet will also be affected by this change, be sure to reflect changes here too. |
This PR proposes to extend the
jekyll new
command with following:cd my_blog
and initiatebundle install
ref: #5225