Skip to content

Commit

Permalink
Merge pull request #287 from danger/version
Browse files Browse the repository at this point in the history
Add --version support
  • Loading branch information
f-meloni authored Oct 22, 2019
2 parents f0e23e9 + 4d849f8 commit c5c8473
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 343 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

## Master

- Add --version support [@f-meloni][] - [#278](https://github.com/danger/swift/pull/287)

## 2.0.6

- Fix GitLabDSL parsing (missing arguments) [@fortmarek][] - [#283](https://github.com/danger/swift/pull/283)
Expand Down
5 changes: 5 additions & 0 deletions Sources/Runner/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ let isVerbose = CommandLine.arguments.contains("--verbose") || (ProcessInfo.proc
let isSilent = CommandLine.arguments.contains("--silent")
let logger = Logger(isVerbose: isVerbose, isSilent: isSilent)

guard !CommandLine.arguments.contains("--version") else {
logger.logInfo(DangerVersion)
exit(0)
}

do {
if cliLength > 1 {
logger.debug("Launching Danger Swift \(CommandLine.arguments[1]) (v\(DangerVersion))")
Expand Down
Loading

0 comments on commit c5c8473

Please sign in to comment.