Skip to content

Commit 16a891e

Browse files
committed
Update config file if it exists
Signed-off-by: Mostafa Ahangarha <[email protected]>
1 parent 99c518c commit 16a891e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/generators/react/install_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class InstallGenerator < ::Rails::Generators::Base
1818

1919
# For Shakapacker below version 7, we need to set relative path for source_entry_path
2020
def modify_webpacker_yml
21-
if webpacker?
22-
webpacker_yml_path = 'config/webpacker.yml'
21+
webpacker_yml_path = 'config/webpacker.yml'
22+
if webpacker? && Pathname.new(webpacker_yml_path).exist?
2323
gsub_file(
2424
webpacker_yml_path,
2525
"source_entry_path: /\n",

0 commit comments

Comments
 (0)