shell: rework code to use shell.spawn
spawn gives out streams and we have more control over the stdout/stderr buffers. otherwise, we have to provide a max buffer capture size to exec
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ function setProgress(task, message) {
|
||||
async function ensureDhparams() {
|
||||
if (fs.existsSync(paths.DHPARAMS_FILE)) return;
|
||||
debug('ensureDhparams: generating dhparams');
|
||||
const dhparams = await shell.exec('openssl dhparam -dsaparam 2048', {});
|
||||
const dhparams = await shell.spawn('openssl', ['dhparam', '-dsaparam', '2048'], { encoding: 'utf8' });
|
||||
if (!safe.fs.writeFileSync(paths.DHPARAMS_FILE, dhparams)) throw new BoxError(BoxError.FS_ERROR, `Could not save dhparams.pem: ${safe.error.message}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user