function exec(command, args) {
    return new Promise((resolve, reject) => {
        const stderr = new BufferStream()
        const cp = spawn(command, args, { stdio: ["ignore", "ignore", "pipe"] })

        cp.stderr.pipe(stderr)
        cp.on("exit", (exitCode) => {
            if (exitCode) {
                reject(new Error(`Exited with ${exitCode}: ${stderr.value}`))
                return
            }
            resolve()
        })
        cp.on("error", reject)
    })
}
Execute a command.
@param {string} command A command to execute.
@param {string[]} args Arguments for the command.
@returns {Promise<void>} The result of child process's stdout.