updater: async'ify

This commit is contained in:
Girish Ramakrishnan
2021-08-31 13:12:14 -07:00
parent d225a687a5
commit b5d6588e3e
3 changed files with 73 additions and 96 deletions

View File

@@ -30,11 +30,13 @@ function exec(tag, cmd, callback) {
child_process.exec(cmd, function (error, stdout, stderr) {
const stdoutResult = stdout.toString('utf8');
const stderrResult = stderr.toString('utf8');
debug(`${tag} (stdout): %s`, stdoutResult);
debug(`${tag} (stderr): %s`, stderr.toString('utf8'));
debug(`${tag} (stderr): %s`, stderrResult);
if (error) error.stdout = stdoutResult; // when promisified, this is the way to get stdout
if (error) error.stderr = stderrResult; // when promisified, this is the way to get stderr
callback(error, stdoutResult);
});