From b51d3584929f43a134f763612248563b946d50a2 Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 22 Apr 2022 18:30:23 +0100 Subject: [PATCH] [Registry] Minor source cleanup --- src/utils/registry.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/registry.js b/src/utils/registry.js index 35b9a66..9319fc1 100644 --- a/src/utils/registry.js +++ b/src/utils/registry.js @@ -1,19 +1,19 @@ const CP = require('child_process'); -exports.spawn = (args, callback) => { +exports.spawn = (args, cb) => { const process = CP.spawn('reg.exe', args); let out = ''; process.stdout.on('data', data => out += data); - process.on('error', e => callback(e, out)); - process.on('exit', (c, s) => callback(c !== 0 ? (s ?? c) : null, out)); + process.on('error', e => cb(e, out)); + process.on('exit', (c, s) => cb(c !== 0 ? (s ?? c) : null, out)); }; -exports.add = (todo, callback) => { +exports.add = (todo, cb) => { const x = todo.shift(); - if (!x) return callback(); + if (!x) return cb(); - exports.spawn([ 'add', ...x, '/f' ], () => exports.add(todo, callback)); + exports.spawn([ 'add', ...x, '/f' ], () => exports.add(todo, cb)); }; \ No newline at end of file