From 70482376ad16acf07a9f0b3f6abd5c9a546257bc Mon Sep 17 00:00:00 2001 From: Oj Date: Wed, 27 Apr 2022 21:31:36 +0100 Subject: [PATCH] [Registry] Rewrite spawn --- src/utils/registry.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils/registry.js b/src/utils/registry.js index 9319fc1..6479305 100644 --- a/src/utils/registry.js +++ b/src/utils/registry.js @@ -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();