-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Do not fail trying to append_to_file which does not exist #269
Conversation
@nfedyashev Thanks for the fix. If you could make rubocop happy I will merge this in 👍 There seems to be an extra whitespace on line 20 in template.rb |
@gauravtiwari sorry about that! The commit has just been updated |
lib/install/template.rb
Outdated
@@ -11,10 +11,12 @@ | |||
directory "#{__dir__}/config/loaders/core", "config/webpack/loaders" | |||
copy_file "#{__dir__}/config/.postcssrc.yml", ".postcssrc.yml" | |||
|
|||
append_to_file ".gitignore", <<-EOS | |||
if File.exists?(".gitignore") | |||
append_to_file ".gitignore", <<-EOS |
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.
Lets format it like this so, it's all nicely aligned :)
if File.exists?(".gitignore")
append_to_file ".gitignore", <<-EOS
/public/packs
/node_modules
EOS
end
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 is nicely aligned but the content of that string is now different than what it was
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.
Yepp, I mean that we align that string block inline with append_to_file
so, it's all in one line 👍 At the moment there is 2 whitespace for append_to_file
, but none for string block
thanks @nfedyashev 👍 🍰 |
@gauravtiwari I'm sorry but my job here was to fix the bug so that it doesn't fail if .gitignore is missing. Try it locally:
|
…)" This reverts commit 3ff0517.
@nfedyashev Sorry, you were right 👍 My bad, just reverted the change :) |
Steps to reproduce:
webpacker:install
Expected result:
Successful completion of webpacker:install generator call
Actual result: