Add new danger_local Rake task
The benefit of running the danger_local Rake task is that it displays some informational messages for clarity and also exits with 1 if there's any output.
This commit is contained in:
parent
75dae7fe80
commit
fdc17ebc03
|
@ -0,0 +1,17 @@
|
|||
desc 'Run local Danger rules'
|
||||
task :danger_local do
|
||||
require 'gitlab_danger'
|
||||
require_relative '../../lib/gitlab/popen'
|
||||
|
||||
puts("#{GitlabDanger.local_warning_message}\n")
|
||||
|
||||
# _status will _always_ be 0, regardless of failure or success :(
|
||||
output, _status = Gitlab::Popen.popen(%w{danger dry_run})
|
||||
|
||||
if output.empty?
|
||||
puts(GitlabDanger.success_message)
|
||||
else
|
||||
puts(output)
|
||||
exit(1)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue