#!/usr/bin/env node
'use strict';
const program = require('commander');
const fs = require('fs');
const listAndRun = require('./list-and-run');
const path = '/tmp/te';

program.parse(process.argv);

const line = program.args;
const file = fs.readFileSync(path, 'utf8');
fs.writeFileSync(path+'0', file);

var lines = [];
if (file.length) {
    var lines = file.split('\n');
}
lines.push(line);

fs.writeFileSync(path, lines.join('\n'));

listAndRun();

@@ -302,141 +302,101 @@
 );%0A%0A
-var lines = %5B%5D;%0Aif (file.length) %7B%0A    var lines = file.split('%5Cn');%0A%7D%0Alines.push(line);%0A%0Afs.writeFileSync(path, lines.join('%5Cn'));%0A%0A
+fs.appendFile(path, '%5Cn'+line, (err) =%3E %7B%0A    if (err) %7B%0A        console.log(err);%0A    %7D%0A    
 list
@@ -405,8 +405,12 @@
 dRun();%0A
+%7D);%0A

Change te-append to use appendFile instead of readFileSync/writeFileSync