File tree 3 files changed +9
-13
lines changed
3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 1
- import program from "commander"
1
+ import { Command } from "commander"
2
2
import chalk from "chalk"
3
3
4
- process . on ( "unhandledRejection" , function ( reason : string , _p : any ) {
4
+ process . on ( "unhandledRejection" , function ( reason : string , _p : any ) {
5
5
console . log ( chalk . red ( "Error: " ) , reason )
6
6
process . exitCode = 1
7
7
} )
8
8
9
- export interface SharedCLI extends program . CommanderStatic {
9
+ export interface SharedCLI extends Command {
10
10
/** Should we be posting as much info as possible? */
11
11
verbose : boolean
12
12
/** Output to STDOUT instead of leaving a comment */
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import { DangerDSLJSONType } from "../dsl/DangerDSL"
3
3
import { CliArgs } from "../dsl/cli-args"
4
4
import { CISource } from "../ci_source/ci_source"
5
5
import { emptyGitJSON } from "../platforms/github/GitHubGit"
6
- import { CommanderStatic } from "commander"
6
+ import { Command } from "commander"
7
7
8
8
export const jsonDSLGenerator = async (
9
9
platform : Platform ,
10
10
source : CISource ,
11
- program : CommanderStatic
11
+ program : Command
12
12
) : Promise < DangerDSLJSONType > => {
13
13
const useSimpleDSL = platform . getPlatformReviewSimpleRepresentation && source . useEventDSL
14
14
@@ -27,7 +27,7 @@ export const jsonDSLGenerator = async (
27
27
id : program . id ,
28
28
textOnly : program . textOnly ,
29
29
verbose : program . verbose ,
30
- staging : program . staging
30
+ staging : program . staging ,
31
31
}
32
32
33
33
const dslPlatformName = jsonDSLPlatformName ( platform )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { jsonToDSL } from "./jsonToDSL"
3
3
import { contextForDanger , DangerContext } from "./Dangerfile"
4
4
import { DangerDSLJSON } from "./dangerDSLJSON"
5
5
import { CISource } from "../ci_source/ci_source"
6
- import { CommanderStatic } from "commander"
6
+ import { Command } from "commander"
7
7
8
8
/**
9
9
* Reads in the JSON string converts to a dsl object and gets the change context
@@ -12,12 +12,8 @@ import { CommanderStatic } from "commander"
12
12
* @param program {any} commander
13
13
* @returns {Promise<DangerContext> } context for danger
14
14
*/
15
- export async function jsonToContext (
16
- JSONString : string ,
17
- program : CommanderStatic ,
18
- source : CISource
19
- ) : Promise < DangerContext > {
20
- const dslJSON = { danger : new DangerDSLJSON ( JSONString , ( program as any ) as CliArgs ) }
15
+ export async function jsonToContext ( JSONString : string , program : Command , source : CISource ) : Promise < DangerContext > {
16
+ const dslJSON = { danger : new DangerDSLJSON ( JSONString , program as any as CliArgs ) }
21
17
const dsl = await jsonToDSL ( dslJSON . danger , source )
22
18
return contextForDanger ( dsl )
23
19
}
You can’t perform that action at this time.
0 commit comments