Add quotes to user-agent in debug command line
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var async = require('async');
|
||||
var Q = require('q');
|
||||
var ps = require('ps-node');
|
||||
var path = require('path');
|
||||
var debug = require('debug')('ylt:phantomaswrapper');
|
||||
var phantomas = require('phantomas');
|
||||
|
||||
@@ -46,8 +47,8 @@ var PhantomasWrapper = function() {
|
||||
'windowPerformance' // overriden
|
||||
].join(','),
|
||||
'include-dirs': [
|
||||
'lib/tools/phantomas/custom_modules/core',
|
||||
'lib/tools/phantomas/custom_modules/modules'
|
||||
path.join(__dirname, 'custom_modules/core'),
|
||||
path.join(__dirname, 'custom_modules/modules')
|
||||
].join(',')
|
||||
};
|
||||
|
||||
@@ -55,7 +56,14 @@ var PhantomasWrapper = function() {
|
||||
debug('If you want to reproduce the phantomas task only, copy the following command line:');
|
||||
var optionsString = '';
|
||||
for (var opt in options) {
|
||||
optionsString += ' ' + '--' + opt + '=' + options[opt];
|
||||
var value = options[opt];
|
||||
|
||||
if ((typeof value === 'string' || value instanceof String) && value.indexOf(' ') >= 0) {
|
||||
value = '"' + value + '"';
|
||||
}
|
||||
|
||||
optionsString += ' ' + '--' + opt + '=' + value;
|
||||
|
||||
}
|
||||
debug('node node_modules/phantomas/bin/phantomas.js --url=' + task.url + optionsString + ' --verbose');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user