From 8ca372dc500d16a2343aaade7646647aac6925b3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 7 Jun 2018 18:11:48 +0200 Subject: [PATCH] Dont ask whether to overwrite an existing app/javascript directory as Rails 6 will create one by default --- lib/install/template.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/install/template.rb b/lib/install/template.rb index c118ca845..b89f1d9bd 100644 --- a/lib/install/template.rb +++ b/lib/install/template.rb @@ -13,8 +13,12 @@ say "Copying .browserslistrc to app root directory" copy_file "#{__dir__}/config/.browserslistrc", ".browserslistrc" -say "Creating JavaScript app source directory" -directory "#{__dir__}/javascript", Webpacker.config.source_path +if Dir.exists?(Webpacker.config.source_path) + say "The JavaScript app source directory already exists" +else + say "Creating JavaScript app source directory" + directory "#{__dir__}/javascript", Webpacker.config.source_path +end apply "#{__dir__}/binstubs.rb"