File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function get_path(args) {
2424 let filename = args . _ [ 1 ] ;
2525 if ( filename !== path . basename ( filename ) ) {
2626 // filename is an absolute path
27- return filename ;
27+ return filename ;
2828 }
2929 return path . join ( process . cwd ( ) , args . _ [ 1 ] ) ;
3030 }
@@ -39,7 +39,13 @@ module.exports = function init(args) {
3939 if ( path_to_json === undefined ) return ;
4040
4141 // append .json if filename passed is not of json type
42- if ( path . extname ( path_to_json ) !== ".json" ) path_to_json += '.json' ;
42+ if ( path . extname ( path_to_json ) !== '' && path . extname ( path_to_json ) !== ".json" ) path_to_json += ".json" ;
43+
44+ // append browserstack.json if filename is a path without filename
45+ if ( path . extname ( path_to_json ) === '' ) path_to_json = path . join ( path_to_json , "browserstack.json" ) ;
46+
47+ console . log ( path_to_json ) ;
48+ return path_to_json ;
4349
4450 let config = {
4551 file : require ( '../templates/configTemplate' ) ( ) ,
You can’t perform that action at this time.
0 commit comments