Skip to content

Commit

Permalink
silence yarn output if checking is successfull
Browse files Browse the repository at this point in the history
  • Loading branch information
doits committed Dec 19, 2017
1 parent 9a47275 commit dd93406
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/webpacker/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Webpacker::Engine < ::Rails::Engine
# - add `config.webpacker.check_yarn_integrity = false`
initializer "webpacker.yarn_check" do |app|
if File.exist?("yarn.lock") && app.config.webpacker.check_yarn_integrity
ok = system("yarn check --integrity")
output = `yarn check --integrity 2>&1`

if !ok
unless $?.success?
warn "\n\n"
warn "========================================"
warn " Your Yarn packages are out of date!"
Expand All @@ -37,6 +37,10 @@ class Webpacker::Engine < ::Rails::Engine
warn "To disable this check, please add `config.webpacker.check_yarn_integrity = false`"
warn "to your Rails development config file (config/environments/development.rb)."
warn "\n\n"
warn "Yarn output while checking for integrity:"
warn "\n\n"
warn output
warn "\n\n"

exit(1)
end
Expand Down

0 comments on commit dd93406

Please sign in to comment.