From 5552c7be81486e03ec4ccbe2c15e7d19a5c67018 Mon Sep 17 00:00:00 2001 From: Franco Meloni Date: Sun, 20 Oct 2019 12:16:12 +0100 Subject: [PATCH 1/2] Move base to local and handle staging --- source/commands/danger-local.ts | 2 ++ source/commands/danger-pr.ts | 2 +- source/commands/utils/sharedDangerfileArgs.ts | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/commands/danger-local.ts b/source/commands/danger-local.ts index 67d4e8fad..8e035b8be 100644 --- a/source/commands/danger-local.ts +++ b/source/commands/danger-local.ts @@ -19,6 +19,8 @@ program // TODO: this option // .option("-s, --staging", "Just use staged changes.") .description("Runs danger without PR metadata, useful for git hooks.") + .option("-b, --base [branch_name]", "Use a different base branch") + .option("-s, --staging", "Use a different base branch") setSharedArgs(program).parse(process.argv) const app = (program as any) as App diff --git a/source/commands/danger-pr.ts b/source/commands/danger-pr.ts index edab8f511..2cdcde73f 100644 --- a/source/commands/danger-pr.ts +++ b/source/commands/danger-pr.ts @@ -67,7 +67,7 @@ const app = (program as any) as App const customProcess = !!app.process if (program.args.length === 0) { - console.error("Please include a PR URL to run against") + console.error("") process.exitCode = 1 } else { const customHost = diff --git a/source/commands/utils/sharedDangerfileArgs.ts b/source/commands/utils/sharedDangerfileArgs.ts index 246e72397..65f3fe604 100644 --- a/source/commands/utils/sharedDangerfileArgs.ts +++ b/source/commands/utils/sharedDangerfileArgs.ts @@ -38,7 +38,6 @@ export default (command: any) => "Specify a custom dangerfile path, remote urls only work with github" ) .option("-i, --id [danger_id]", "Specify a unique Danger ID for the Danger run") - .option("-b, --base [branch_name]", "Use a different base branch") .option("-c, --external-ci-provider [modulePath]", "Specify custom CI provider") .option("-p, --process [command]", "[dev] Runs a custom sub-process instead of the Danger JS runtime") .option("-u, --passURLForDSL", "[dev] Use a custom URL to send the Danger DSL into the sub-process") From f8d65d4ab0233da8415862bcb7dd0d5015c74b64 Mon Sep 17 00:00:00 2001 From: Franco Meloni Date: Sun, 20 Oct 2019 16:26:01 +0100 Subject: [PATCH 2/2] Revert code added by mistake --- source/commands/danger-local.ts | 1 - source/commands/danger-pr.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/source/commands/danger-local.ts b/source/commands/danger-local.ts index 8e035b8be..c4ba06ec3 100644 --- a/source/commands/danger-local.ts +++ b/source/commands/danger-local.ts @@ -20,7 +20,6 @@ program // .option("-s, --staging", "Just use staged changes.") .description("Runs danger without PR metadata, useful for git hooks.") .option("-b, --base [branch_name]", "Use a different base branch") - .option("-s, --staging", "Use a different base branch") setSharedArgs(program).parse(process.argv) const app = (program as any) as App diff --git a/source/commands/danger-pr.ts b/source/commands/danger-pr.ts index 2cdcde73f..edab8f511 100644 --- a/source/commands/danger-pr.ts +++ b/source/commands/danger-pr.ts @@ -67,7 +67,7 @@ const app = (program as any) as App const customProcess = !!app.process if (program.args.length === 0) { - console.error("") + console.error("Please include a PR URL to run against") process.exitCode = 1 } else { const customHost =