Skip to content

Commit

Permalink
Does some process faffing
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Oct 20, 2018
1 parent 224d325 commit 3fa0cbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions source/commands/ci/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export interface RunnerConfig {
platform: Platform
/** Additional env vars which are passed through to the subprocess */
additionalEnvVars: object
/** Replace the default danger-js sub-process runner with something else */
process: string
}

export const runRunner = async (app: SharedCLI, config?: Partial<RunnerConfig>) => {
Expand Down Expand Up @@ -67,17 +65,15 @@ export const runRunner = async (app: SharedCLI, config?: Partial<RunnerConfig>)
dangerID: app.id || "default",
}

const processName = app.process || (config && config.process)
const configProcessArgs = processName && processName.split(" ")
const runnerCommand = configProcessArgs || dangerRunToRunnerCLI(process.argv)
const processName = (app.process && app.process.split(" ")) || undefined
const runnerCommand = processName || dangerRunToRunnerCLI(process.argv)
d(`Preparing to run: ${runnerCommand}`)

// Make concrete type for the runner config with a mix of the defaults
// and the partial config from the top
const runConfig: RunnerConfig = {
source,
platform,
process: runnerCommand,
additionalEnvVars: (config && config.additionalEnvVars) || {},
}

Expand Down
1 change: 0 additions & 1 deletion source/commands/danger-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ getRuntimeCISource(app).then(source => {
const runConfig: RunnerConfig = {
source,
platform,
process: subprocessName,
additionalEnvVars: {},
}

Expand Down

0 comments on commit 3fa0cbe

Please sign in to comment.