diff options
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -68,7 +68,6 @@ try { } } } - let pargv = process.argv; pargv[1] = "twi"; @@ -104,8 +103,13 @@ try { console.log(c.yellow("warn:") + " process was stopped unexpectedly"); } } + fs.writeFileSync(home + "/runtime.pid", process.pid.toString()); let command = argv._[0]; + let aliases = require('./commands/aliases.json'); + if ([].concat(Object.keys(aliases).map(i => aliases[i])).flat(1).includes(command)) { + command = Object.keys(aliases).map(i => { if (aliases[i].includes(command)) { return i; } else { return null; } }).filter(i => i !== null)[0]; + } await require('./commands/' + command)(argv); fs.rmSync(home + "/runtime.pid"); |