File tree 3 files changed +29
-12
lines changed
3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 83
83
"command" : " vscode-anchor.install" ,
84
84
"title" : " Anchor: Install CLI"
85
85
},
86
+ {
87
+ "command" : " vscode-anchor.solanaInstall" ,
88
+ "title" : " Anchor: Install Solana"
89
+ },
86
90
{
87
91
"command" : " vscode-anchor.new" ,
88
92
"title" : " Anchor: New Program (in same workspace)"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { anchorVerify } from "./verify";
4
4
import { anchorInit } from "./scaffold" ;
5
5
import { anchorNew } from "./new" ;
6
6
import { anchorDeploy } from "./deploy" ;
7
- import { anchorInstall } from "./install" ;
7
+ import { anchorInstall , solanaInstall } from "./install" ;
8
8
import { anchorUpgrade } from "./upgrade" ;
9
9
import { anchorAnalyze } from "./analyze" ;
10
10
import { anchorHelp } from "./help" ;
@@ -17,6 +17,7 @@ const commands = [
17
17
anchorHelp ( ) ,
18
18
anchorInit ( ) ,
19
19
anchorInstall ( ) ,
20
+ solanaInstall ( ) ,
20
21
anchorNew ( ) ,
21
22
anchorRemoveDockerImage ( ) ,
22
23
anchorTest ( ) ,
Original file line number Diff line number Diff line change 1
- import * as vscode from ' vscode' ;
1
+ import * as vscode from " vscode" ;
2
2
import { EXT_NAME } from "../config" ;
3
3
import chan from "../helpers/outputChannel" ;
4
4
import { checkAvm , installAnchorUsingAvm , installAvm } from "../helpers/avm" ;
5
+ import { checkInstallSolana } from "../helpers/install" ;
5
6
6
- export const anchorInstall = ( ) => vscode . commands . registerCommand (
7
- `${ EXT_NAME } .install` ,
8
- async ( ) => {
9
- try {
7
+ export const anchorInstall = ( ) =>
8
+ vscode . commands . registerCommand ( `${ EXT_NAME } .install` , async ( ) => {
9
+ try {
10
10
try {
11
11
await checkAvm ( ) ;
12
12
} catch ( err ) {
13
13
await installAvm ( ) ;
14
14
} finally {
15
15
await installAnchorUsingAvm ( ) ;
16
16
}
17
- } catch ( err ) {
18
- if ( err instanceof Error ) {
19
- chan . appendLine ( err . message ) ;
20
- chan . show ( true ) ;
17
+ } catch ( err ) {
18
+ if ( err instanceof Error ) {
19
+ chan . appendLine ( err . message ) ;
20
+ chan . show ( true ) ;
21
+ }
22
+ }
23
+ } ) ;
24
+
25
+ export const solanaInstall = ( ) =>
26
+ vscode . commands . registerCommand ( `${ EXT_NAME } .solanaInstall` , async ( ) => {
27
+ try {
28
+ await checkInstallSolana ( ) ;
29
+ } catch ( err ) {
30
+ if ( err instanceof Error ) {
31
+ chan . appendLine ( err . message ) ;
32
+ chan . show ( true ) ;
33
+ }
21
34
}
22
- } }
23
- ) ;
35
+ } ) ;
You can’t perform that action at this time.
0 commit comments