[Registry] Rewrite spawn
This commit is contained in:
parent
b8d8d81405
commit
70482376ad
|
@ -1,15 +1,7 @@
|
||||||
const CP = require('child_process');
|
const CP = require('child_process');
|
||||||
|
|
||||||
|
|
||||||
exports.spawn = (args, cb) => {
|
exports.spawn = (args, cb) => CP.execFile('reg.exe', 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.add = (todo, cb) => {
|
exports.add = (todo, cb) => {
|
||||||
const x = todo.shift();
|
const x = todo.shift();
|
||||||
|
|
Loading…
Reference in New Issue