Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/Local.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ function Local(){

const binaryPath = this.getBinaryPath(null, options['bs-host']);
that.binaryPath = binaryPath;
childProcess.exec('echo "" > ' + that.logfile);
try {
fs.writeFileSync(that.logfile, '');
} catch(e) {
console.error('Could not clear log file: ', e.message);
}
that.opcode = 'start';
if(!this.binaryPath){
return new LocalError('Couldn\'t find binary file');
Expand Down Expand Up @@ -86,7 +90,11 @@ function Local(){

this.getBinaryPath(function(binaryPath){
that.binaryPath = binaryPath;
childProcess.exec('echo "" > ' + that.logfile);
try {
fs.writeFileSync(that.logfile, '');
} catch(e) {
console.error('Could not clear log file: ', e.message);
}

that.opcode = 'start';
that.tunnel = childProcess.execFile(that.binaryPath, that.getBinaryArgs(), function(error, stdout, stderr){
Expand Down
Loading