(args)
| 39 | } |
| 40 | |
| 41 | async exec (args) { |
| 42 | if (args.length !== 1) { |
| 43 | throw this.usageError() |
| 44 | } |
| 45 | |
| 46 | const path = splitPackageNames(args[0]) |
| 47 | const dir = resolve(this.npm.dir, path) |
| 48 | |
| 49 | await lstat(dir) |
| 50 | await input.start(() => new Promise((res, rej) => { |
| 51 | const [bin, ...spawnArgs] = this.npm.config.get('editor').split(/\s+/) |
| 52 | const editor = cp.spawn(bin, [...spawnArgs, dir], { stdio: 'inherit' }) |
| 53 | editor.on('exit', (code) => { |
| 54 | if (code) { |
| 55 | return rej(new Error(`editor process exited with code: ${code}`)) |
| 56 | } |
| 57 | res() |
| 58 | }) |
| 59 | })) |
| 60 | await this.npm.exec('rebuild', [dir]) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | module.exports = Edit |
nothing calls this directly
no test coverage detected