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 964d1eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phantomflow",
"version": "1.1.4",
"version": "1.1.5",
"description": "UI testing with PhantomCSS and Decision Trees",
"main": "phantomflow.js",
"repository": {
Expand Down
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 964d1eb

Please sign in to comment.