diff --git a/lib/Local.js b/lib/Local.js index ad35fd4..26efac4 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -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'); @@ -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){