1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #41824 from jaredbeck/patch-7

Exit before assets:precompile task if yarn:install fails
This commit is contained in:
Eugene Kenny 2021-04-29 13:59:04 +01:00 committed by GitHub
commit 7bd6a74e87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,11 @@ namespace :yarn do
"--immutable"
end
system({ "NODE_ENV" => node_env }, "#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}")
system(
{ "NODE_ENV" => node_env },
"#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}",
exception: true
)
rescue Errno::ENOENT
$stderr.puts "bin/yarn was not found."
$stderr.puts "Please run `bundle exec rails app:update:bin` to create it."