Skip to content

Commit

Permalink
minor: avoid exit without callbacks
Browse files Browse the repository at this point in the history
For cases where the validation of a showoff listreturns an error,
calling `exit!` instead of `exit 1` causes output to get lost if
redirected. This could be whilst running in a container, or if
writing to a file.
  • Loading branch information
Charlotte Levin committed Sep 23, 2021
1 parent 4856f39 commit 36b6ee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/showoff/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def profile
end
rescue LoadError
puts "ERROR: The #{renderer} markdown rendering engine does not appear to be installed correctly."
exit! 1
exit 1
end

profile
Expand Down
4 changes: 2 additions & 2 deletions lib/showoff_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def self.validate(config)
puts "Found #{errors.size} errors."
unless errors.empty?
errors.each { |err| puts " * #{err}" }
exit!
exit 1
end
end

Expand Down Expand Up @@ -715,7 +715,7 @@ def self.setup(dir_name)
end
rescue LoadError
puts "ERROR: The #{renderer} markdown rendering engine does not appear to be installed correctly."
exit! 1
exit 1
end
end

Expand Down

0 comments on commit 36b6ee9

Please sign in to comment.