diff options
Diffstat (limited to 'deps/npm/lib/commands/edit.js')
-rw-r--r-- | deps/npm/lib/commands/edit.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/deps/npm/lib/commands/edit.js b/deps/npm/lib/commands/edit.js index 0256f4f3a6f..67ac32e0171 100644 --- a/deps/npm/lib/commands/edit.js +++ b/deps/npm/lib/commands/edit.js @@ -58,11 +58,16 @@ class Edit extends BaseCommand { } const [bin, ...args] = this.npm.config.get('editor').split(/\s+/) const editor = cp.spawn(bin, [...args, dir], { stdio: 'inherit' }) - editor.on('exit', (code) => { + editor.on('exit', async (code) => { if (code) { return reject(new Error(`editor process exited with code: ${code}`)) } - this.npm.exec('rebuild', [dir]).catch(reject).then(resolve) + try { + await this.npm.exec('rebuild', [dir]) + } catch (err) { + reject(err) + } + resolve() }) }) }) |