Skip to content

Commit

Permalink
Merge pull request #307 from grosser/zdrve/err
Browse files Browse the repository at this point in the history
Send all invalid mentions output to stderr
  • Loading branch information
grosser committed Feb 13, 2024
2 parents 1552a79 + 8719780 commit 173b28d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/kennel/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def git_push?

if bad.any?
url = Kennel::Utils.path_to_url "/account/settings"
Kennel.out.puts "Invalid mentions found, either ignore them by adding to `KNOWN` env var or add them via #{url}"
bad.each { |f, v| Kennel.out.puts "Invalid mention #{v} in monitor message of #{f}" }
Kennel.err.puts "Invalid mentions found, either ignore them by adding to `KNOWN` env var or add them via #{url}"
bad.each { |f, v| Kennel.err.puts "Invalid mention #{v} in monitor message of #{f}" }
Kennel::Tasks.abort ENV["KNOWN_WARNING"]
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/kennel/tasks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def execute(...)
it "fails when unknown mentions are used" do
content[:message] = "@oo@ps"
assert_raises { execute }.message.must_equal "Aborted SystemExit"
stdout.string.must_include "Invalid mentions"
stderr.string.must_include "Invalid mentions"
end
end

Expand Down

0 comments on commit 173b28d

Please sign in to comment.