lib/danger/commands/runner.rb in danger-3.5.3 vs lib/danger/commands/runner.rb in danger-3.5.4

- old
+ new

@@ -35,11 +35,12 @@ dangerfile = argv.option("dangerfile", "Dangerfile") @dangerfile_path = dangerfile if File.exist?(dangerfile) @base = argv.option("base") @head = argv.option("head") @fail_on_errors = argv.option("fail-on-errors", false) - @danger_id = argv.option("danger_id", "danger") + new_comment = argv.flag?("new-comment") + @danger_id = new_comment ? Time.now.strftime("%v %H:%M:%S") : argv.option("danger_id", "danger") @cork = Cork::Board.new(silent: argv.option("silent", false), verbose: argv.option("verbose", false)) super end @@ -54,10 +55,11 @@ [ ["--base=[master|dev|stable]", "A branch/tag/commit to use as the base of the diff"], ["--head=[master|dev|stable]", "A branch/tag/commit to use as the head"], ["--fail-on-errors=<true|false>", "Should always fail the build process, defaults to false"], ["--dangerfile=<path/to/dangerfile>", "The location of your Dangerfile"], - ["--danger_id=<id>", "The identifier of this Danger instance"] + ["--danger_id=<id>", "The identifier of this Danger instance"], + ["--new-comment", "Makes the build process ignore other Danger instances, resulting in a new comment. Overrides '--danger_id'."] ].concat(super) end def run Executor.new(ENV).run(