Skip to content

Commit c98afb3

Browse files
committed
release 0.2.6
1 parent 75b2495 commit c98afb3

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
"command": "vscode-anchor.install",
8484
"title": "Anchor: Install CLI"
8585
},
86+
{
87+
"command": "vscode-anchor.solanaInstall",
88+
"title": "Anchor: Install Solana"
89+
},
8690
{
8791
"command": "vscode-anchor.new",
8892
"title": "Anchor: New Program (in same workspace)"

src/commands/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { anchorVerify } from "./verify";
44
import { anchorInit } from "./scaffold";
55
import { anchorNew } from "./new";
66
import { anchorDeploy } from "./deploy";
7-
import { anchorInstall } from "./install";
7+
import { anchorInstall, solanaInstall } from "./install";
88
import { anchorUpgrade } from "./upgrade";
99
import { anchorAnalyze } from "./analyze";
1010
import { anchorHelp } from "./help";
@@ -17,6 +17,7 @@ const commands = [
1717
anchorHelp(),
1818
anchorInit(),
1919
anchorInstall(),
20+
solanaInstall(),
2021
anchorNew(),
2122
anchorRemoveDockerImage(),
2223
anchorTest(),

src/commands/install.ts

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
import * as vscode from 'vscode';
1+
import * as vscode from "vscode";
22
import { EXT_NAME } from "../config";
33
import chan from "../helpers/outputChannel";
44
import { checkAvm, installAnchorUsingAvm, installAvm } from "../helpers/avm";
5+
import { checkInstallSolana } from "../helpers/install";
56

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 {
1010
try {
1111
await checkAvm();
1212
} catch (err) {
1313
await installAvm();
1414
} finally {
1515
await installAnchorUsingAvm();
1616
}
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+
}
2134
}
22-
}}
23-
);
35+
});

0 commit comments

Comments
 (0)