File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -32,19 +32,14 @@ module.exports = async () => {
32
32
} catch ( err ) {
33
33
await fs . remove ( tempDir ) ;
34
34
if ( err . code === "ETARGET" ) {
35
- spinner . fail (
36
- chalk . red (
37
- `version '${ err . wanted } ' not found in npm registry\navailable versions:`
38
- )
35
+ const msg = chalk . red (
36
+ `version '${ err . wanted } ' not found in npm registry\navailable versions:\n`
39
37
) ;
40
- console . log ( err . versions . reverse ( ) . join ( " | " ) ) ;
41
- process . exit ( 1 ) ;
42
- } /* istanbul ignore next */ else {
43
- spinner . fail ( "Unexpected error" ) ;
44
- console . error ( err ) ;
45
- process . exit ( - 1 ) ;
38
+ spinner . fail ( msg + err . versions . reverse ( ) . join ( " | " ) ) ;
39
+ throw err . code ;
46
40
}
47
- return ;
41
+ spinner . fail ( "Unexpected error" ) ;
42
+ throw new Error ( err ) ;
48
43
}
49
44
await fs . copy ( tempDir + "/dist" , targetDir ) ;
50
45
await fs . remove ( tempDir ) ;
You can’t perform that action at this time.
0 commit comments