Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit b55a7ba

Browse files
author
Lucas Rojas
committed
Clean comments from processtools.js
1 parent dd92579 commit b55a7ba

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

lib/processTools.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ var node_modules = 'node_modules';
1414

1515
function writeOutput(text, bufferedOutput, source, title) {
1616

17-
// split output by line
1817
var lines = (title + bufferedOutput + text).split(/\r?\n/);
19-
20-
// buffer content from last line, in case it hasn't been read completely
2118
bufferedOutput = lines.pop();
2219

23-
// write complete lines to output
2420
lines.forEach(function (line) {
2521
log.debug(line, source);
2622
});
2723

28-
// return buffered output
2924
return bufferedOutput;
3025
}
3126

@@ -47,21 +42,15 @@ function exec (command, args, options, callback) {
4742
}
4843
}
4944

50-
// log command line
5145
var title = 'Launching external process: \'' + command + ' ' + args.join(' ') + '\'\n';
52-
53-
// spawn new process
5446
var childProcess = child_process.spawn(command, args, options);
5547

56-
// show progress indicator
5748
if (!options.suppressOutput) {
5849
progress.start(options.statusMessage);
5950
}
6051

61-
// console log source displays the process ID
6252
var source = 'pid:' + childProcess.pid;
6353

64-
// capture stdout
6554
childProcess.stdout.on('data', function (data) {
6655
var text = data.toString();
6756
stdout += text;
@@ -74,7 +63,6 @@ function exec (command, args, options, callback) {
7463
}
7564
});
7665

77-
// capture stderr
7866
childProcess.stderr.on('data', function (data) {
7967
var text = data.toString();
8068
stderr += text;
@@ -87,14 +75,11 @@ function exec (command, args, options, callback) {
8775
}
8876
});
8977

90-
// handle errors
9178
childProcess.on('error', function (err) {
9279
return deferred.reject(err);
9380
});
9481

95-
// process has exited
9682
childProcess.on('exit', function (code) {
97-
// write pending output to console
9883
if (bufferedStdout) {
9984
writeOutput(bufferedStdout);
10085
}
@@ -137,7 +122,7 @@ function getCommandPath(currentPath, command) {
137122
return Q.reject(err);
138123
}
139124

140-
currentPath = currentPath.substring(0, currentPath.lastIndexOf(path.sep));
125+
currentPath = currentPath.substring(0, currentPath.lastIndexOf(path.sep));
141126
if (currentPath.indexOf(node_modules) >= 0) {
142127
if (currentPath.substr(currentPath.length - node_modules.length) === node_modules) {
143128
currentPath = currentPath.substring(0, currentPath.length - node_modules.length);

0 commit comments

Comments
 (0)