@@ -95,18 +95,29 @@ exports.setBuildName = (bsConfig, args) => {
95
95
}
96
96
}
97
97
98
+ // specs can be passed from bstack configuration file
99
+ // specs can be passed via command line args as a string
100
+ // command line args takes precedence over config
98
101
exports . setUserSpecs = ( bsConfig , args ) => {
99
- if ( ! this . isUndefined ( args . specs ) && args . specs . length > 0 && ! this . isUndefined ( args . specs [ 0 ] ) ) {
100
- bsConfig [ 'run_settings' ] [ 'specs' ] = args . specs ;
102
+ let bsConfigSpecs = bsConfig . run_settings . specs ;
103
+
104
+ if ( ! this . isUndefined ( args . specs ) ) {
105
+ bsConfig . run_settings . specs = args . specs . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
106
+ } else if ( ! this . isUndefined ( bsConfigSpecs ) && Array . isArray ( bsConfigSpecs ) ) {
107
+ bsConfig . run_settings . specs = bsConfigSpecs . join ( ',' ) ;
108
+ } else if ( ! this . isUndefined ( bsConfigSpecs ) && typeof ( bsConfigSpecs ) == "string" ) {
109
+ bsConfig . run_settings . specs = bsConfigSpecs . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
110
+ } else {
111
+ bsConfig . run_settings . specs = null ;
101
112
}
102
113
}
103
114
104
- // env option must be set only from args
115
+ // env option must be set only from command line args as a string
105
116
exports . setTestEnvs = ( bsConfig , args ) => {
106
117
if ( ! this . isUndefined ( args . env ) ) {
107
- bsConfig [ ' run_settings' ] [ ' env' ] = args . env ;
118
+ bsConfig . run_settings . env = args . env . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
108
119
} else {
109
- bsConfig [ ' run_settings' ] [ ' env' ] = null ;
120
+ bsConfig . run_settings . env = null ;
110
121
}
111
122
}
112
123
0 commit comments