[Registry] Rewrite spawn

This commit is contained in:
Ducko 2022-04-27 21:31:36 +01:00
parent b8d8d81405
commit 70482376ad
1 changed files with 1 additions and 9 deletions

View File

@ -1,15 +1,7 @@
const CP = require('child_process');
exports.spawn = (args, cb) => {
const process = CP.spawn('reg.exe', args);
let out = '';
process.stdout.on('data', data => out += data);
process.on('error', e => cb(e, out));
process.on('exit', (c, s) => cb(c !== 0 ? (s ?? c) : null, out));
};
exports.spawn = (args, cb) => CP.execFile('reg.exe', args, cb);
exports.add = (todo, cb) => {
const x = todo.shift();