Skip to content

Commit 6259708

Browse files
committed
Moved sanitizePath to the start
1 parent 87e4cd8 commit 6259708

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Local.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ var childProcess = require('child_process'),
88
psTree = require('ps-tree');
99

1010
function Local(){
11+
this.sanitizePath = function(rawPath) {
12+
var doubleQuoteIfRequired = this.windows && !rawPath.match(/"[^"]+"/) ? '"' : '';
13+
return doubleQuoteIfRequired + rawPath + doubleQuoteIfRequired;
14+
};
15+
1116
this.windows = os.platform().match(/mswin|msys|mingw|cygwin|bccwin|wince|emc|win32/i);
1217
this.pid = undefined;
1318
this.isProcessRunning = false;
@@ -255,11 +260,6 @@ function Local(){
255260
return args;
256261
};
257262

258-
this.sanitizePath = function(rawPath) {
259-
var doubleQuoteIfRequired = this.windows && !rawPath.match(/"[^"]+"/) ? '"' : '';
260-
return doubleQuoteIfRequired + rawPath + doubleQuoteIfRequired;
261-
};
262-
263263
this.killAllProcesses = function(callback){
264264
psTree(this.pid, (err, children) => {
265265
var childPids = children.map(val => val.PID);

0 commit comments

Comments
 (0)