File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ export default class NodeCommand extends Command {
46
46
const { flags, args } = await this . parse ( NodeCommand ) ;
47
47
48
48
if ( args . install ) {
49
- await installGraphNode ( flags . tag , flags [ 'bin-dir' ] ) ;
49
+ try {
50
+ await installGraphNode ( flags . tag , flags [ 'bin-dir' ] ) ;
51
+ } catch ( e ) {
52
+ this . error ( `Failed to install: ${ e . message } ` , { exit : 1 } ) ;
53
+ }
50
54
return ;
51
55
}
52
56
@@ -61,9 +65,10 @@ async function installGraphNode(tag?: string, binDir?: string) {
61
65
const tmpDir = await fs . promises . mkdtemp ( path . join ( tmpBase , 'graph-node-' ) ) ;
62
66
let progressBar : ProgressBar | undefined ;
63
67
64
- let downloadPath : string ;
65
- try {
66
- downloadPath = await downloadGraphNodeRelease ( latestRelease , tmpDir , ( downloaded , total ) => {
68
+ const downloadPath = await downloadGraphNodeRelease (
69
+ latestRelease ,
70
+ tmpDir ,
71
+ ( downloaded , total ) => {
67
72
if ( ! total ) return ;
68
73
69
74
progressBar ||= new ProgressBar ( `Downloading ${ latestRelease } [:bar] :percent` , {
@@ -74,11 +79,8 @@ async function installGraphNode(tag?: string, binDir?: string) {
74
79
} ) ;
75
80
76
81
progressBar . tick ( downloaded - ( progressBar . curr || 0 ) ) ;
77
- } ) ;
78
- } catch ( e ) {
79
- print . error ( e ) ;
80
- throw e ;
81
- }
82
+ } ,
83
+ ) ;
82
84
83
85
let extractedPath : string ;
84
86
You can’t perform that action at this time.
0 commit comments