diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-05-04 14:42:42 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-05-04 14:45:05 +0900 |
commit | ca52f784775cf8a7fb3b1519897e5655a0ea7c79 (patch) | |
tree | 4a2434623ee687ef775012f3ca620c7981f886aa /railties | |
parent | 97f7575fde861bd4643eaeca9a32fc1cd8a0b38f (diff) | |
download | rails-ca52f784775cf8a7fb3b1519897e5655a0ea7c79.tar.gz rails-ca52f784775cf8a7fb3b1519897e5655a0ea7c79.tar.bz2 rails-ca52f784775cf8a7fb3b1519897e5655a0ea7c79.zip |
Move `package.json` creation to `create_root_files`
Since `package.json` is created in root directory, it is appropriate to
create it in `create_root_files`.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index aa0e016424..669514b37e 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -67,6 +67,10 @@ module Rails end end + def package_json + template "package.json" + end + def app directory "app" @@ -198,10 +202,6 @@ module Rails def vendor empty_directory_with_keep_file "vendor" - - unless options[:skip_yarn] - template "package.json" - end end end @@ -248,6 +248,7 @@ module Rails build(:gitignore) unless options[:skip_git] build(:gemfile) unless options[:skip_gemfile] build(:version_control) + build(:package_json) unless options[:skip_yarn] end def create_app_files |