@@ -47,16 +47,6 @@ const args = yargs
47
47
. group ( [ 'vcs' , 'buildLogFile' , 'output' , 'removeOldComment' ] , 'Parsing options:' )
48
48
. group ( GITLAB_ARGS , 'GitLab options:' )
49
49
. group ( GITHUB_ARGS , 'GitHub options:' )
50
- . check ( ( options ) => {
51
- // validate VCS configs
52
- if ( options . vcs === 'github' && GITHUB_ARGS . some ( ( arg ) => ! options [ arg ] ) )
53
- throw `GitHub requires [${ GITHUB_ARGS . map ( ( a ) => `--${ a } ` ) . join ( ', ' ) } ] to be set` ;
54
-
55
- if ( options . vcs === 'gitlab' && GITLAB_ARGS . some ( ( arg ) => ! options [ arg ] ) )
56
- throw `GitLab requires [${ GITLAB_ARGS . map ( ( a ) => `--${ a } ` ) . join ( ', ' ) } ] to be set` ;
57
-
58
- return true ;
59
- } )
60
50
. option ( 'buildLogFile' , {
61
51
alias : 'f' ,
62
52
describe : `Build log content files formatted in '<type>;<path>[;<cwd>]'
@@ -128,7 +118,14 @@ and <cwd> is build root directory (optional (Will use current context as cwd)).
128
118
} )
129
119
. check ( ( options ) => {
130
120
if ( options . dryRun ) return true ;
121
+
122
+ // validate VCS configs
131
123
if ( typeof options . vcs === 'undefined' ) throw 'VCS type is required' ;
124
+ if ( options . vcs === 'github' && GITHUB_ARGS . some ( ( arg ) => ! options [ arg ] ) )
125
+ throw `GitHub requires [${ GITHUB_ARGS . map ( ( a ) => `--${ a } ` ) . join ( ', ' ) } ] to be set` ;
126
+ if ( options . vcs === 'gitlab' && GITLAB_ARGS . some ( ( arg ) => ! options [ arg ] ) )
127
+ throw `GitLab requires [${ GITLAB_ARGS . map ( ( a ) => `--${ a } ` ) . join ( ', ' ) } ] to be set` ;
128
+
132
129
return true ;
133
130
} )
134
131
. strict ( )
0 commit comments