Skip to content

Commit

Permalink
Forward stdout when there is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
xtreme-shane-lattanzio authored and JennyYJK committed Jan 18, 2019
1 parent 65564f4 commit ad2caa3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/license_finder/package_manager.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
# frozen_string_literal: false

module LicenseFinder
# Super-class for the different package managers
Expand Down Expand Up @@ -77,12 +77,14 @@ def detected_package_path

def prepare
if self.class.prepare_command
_stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(self.class.prepare_command) }
stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(self.class.prepare_command) }
unless status.success?
log_errors stderr

error_message = "Prepare command '#{self.class.prepare_command}' failed\n#{stderr}"

error_message == error_message.concat("\n#{stdout}\n") if !stdout.nil? && !stdout.empty?

raise error_message unless @prepare_no_fail
end
else
Expand Down

0 comments on commit ad2caa3

Please sign in to comment.