Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #59 from gidztech/master
Browse files Browse the repository at this point in the history
#56 Don't quote args for Unix-based OS
  • Loading branch information
gidztech committed Apr 11, 2017
2 parents ea7d4f6 + 964d1eb commit 6d162da
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 6d162da

Please sign in to comment.