Skip to content

Commit

Permalink
Move package.json creation to create_root_files
Browse files Browse the repository at this point in the history
Since `package.json` is created in root directory, it is appropriate to
create it in `create_root_files`.
  • Loading branch information
y-yagi committed May 4, 2017
1 parent 97f7575 commit ca52f78
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def version_control
end
end

def package_json
template "package.json"
end

def app
directory "app"

Expand Down Expand Up @@ -198,10 +202,6 @@ def tmp

def vendor
empty_directory_with_keep_file "vendor"

unless options[:skip_yarn]
template "package.json"
end
end
end

Expand Down Expand Up @@ -248,6 +248,7 @@ def create_root_files
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
Expand Down

0 comments on commit ca52f78

Please sign in to comment.