Skip to content

Commit

Permalink
HuddleEng#56 Don't quote args for Unix-based OS
Browse files Browse the repository at this point in the history
  • Loading branch information
gidztech committed Apr 11, 2017
1 parent ea7d4f6 commit 9ae8a31
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions phantomflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ module.exports.init = function ( options ) {
return;
}

function quoteItForWindows(str) {
var isWindows = /^win/.test(process.platform);
return isWindows ? '"'+str+'"' : str;
}

if (options.dashboard && options.createReport) {
dashboardLogger.report = report;
}
Expand Down Expand Up @@ -193,17 +198,18 @@ module.exports.init = function ( options ) {
Setup arguments to be sent into PhantomJS
*/

args.push( '"' + changeSlashes( path.join( bootstrapPath, 'start.js' ) ) + '"' );
args.push( '--flowincludes="' + changeSlashes( includes ) + '"' );
args.push( '--flowtestsroot="' + changeSlashes( tests ) + '"' );
args.push( '--flowphantomcssroot="' + changeSlashes(path.dirname(require.resolve( 'phantomcss' )) ) + '"' );
args.push( '--flowlibraryroot="' + changeSlashes( bootstrapPath ) + '"' );
args.push( '--flowoutputroot="' + changeSlashes( dataPath ) + '"' );
args.push( '--flowcoverageroot="' + changeSlashes( coveragePath ) + '"' );
args.push( '--flowxunitoutputroot="' + changeSlashes( xUnitPath ) + '"' );
args.push( '--flowvisualdebugroot="' + changeSlashes( debugPath ) + '"' );
args.push( '--flowvisualstestroot="' + changeSlashes( visualTestsPath ) + '"' );
args.push( '--flowvisualsoutputroot="' + changeSlashes( visualResultsPath ) + '"' );
args.push( quoteItForWindows(changeSlashes( path.join( bootstrapPath, 'start.js' ) ) ) );
args.push( '--flowincludes=' + quoteItForWindows(changeSlashes( includes ) ) );
args.push( '--flowtestsroot=' + quoteItForWindows(changeSlashes( tests )) );
args.push( '--flowphantomcssroot=' + quoteItForWindows(changeSlashes(path.dirname(require.resolve( 'phantomcss' )) ) ) );
args.push( '--flowlibraryroot=' + quoteItForWindows(changeSlashes( bootstrapPath ) ) );
args.push( '--flowoutputroot=' + quoteItForWindows(changeSlashes( dataPath ) ) );
args.push( '--flowcoverageroot=' + quoteItForWindows(changeSlashes( coveragePath )) );
args.push( '--flowxunitoutputroot=' + quoteItForWindows(changeSlashes( xUnitPath ) ));
args.push( '--flowxunitoutputroot=' + quoteItForWindows(changeSlashes( xUnitPath )) );
args.push( '--flowvisualdebugroot=' + quoteItForWindows(changeSlashes( debugPath ) ) );
args.push( '--flowvisualstestroot=' + quoteItForWindows(changeSlashes( visualTestsPath ) ) );
args.push( '--flowvisualsoutputroot=' + quoteItForWindows(changeSlashes( visualResultsPath ) ) );

if ( optionDebug !== void 0 ) {
args.push( '--flowdebug=' + optionDebug );
Expand Down

0 comments on commit 9ae8a31

Please sign in to comment.