From c98afb361bf7e2d9269365f44eea1bd4de20b405 Mon Sep 17 00:00:00 2001 From: Ayush Date: Sat, 2 Apr 2022 03:05:31 +0530 Subject: [PATCH] release 0.2.6 --- package.json | 4 ++++ src/commands/index.ts | 3 ++- src/commands/install.ts | 34 +++++++++++++++++++++++----------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 216471c..7d34f66 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,10 @@ "command": "vscode-anchor.install", "title": "Anchor: Install CLI" }, + { + "command": "vscode-anchor.solanaInstall", + "title": "Anchor: Install Solana" + }, { "command": "vscode-anchor.new", "title": "Anchor: New Program (in same workspace)" diff --git a/src/commands/index.ts b/src/commands/index.ts index e3c0487..4f31f0f 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -4,7 +4,7 @@ import { anchorVerify } from "./verify"; import { anchorInit } from "./scaffold"; import { anchorNew } from "./new"; import { anchorDeploy } from "./deploy"; -import { anchorInstall } from "./install"; +import { anchorInstall, solanaInstall } from "./install"; import { anchorUpgrade } from "./upgrade"; import { anchorAnalyze } from "./analyze"; import { anchorHelp } from "./help"; @@ -17,6 +17,7 @@ const commands = [ anchorHelp(), anchorInit(), anchorInstall(), + solanaInstall(), anchorNew(), anchorRemoveDockerImage(), anchorTest(), diff --git a/src/commands/install.ts b/src/commands/install.ts index c2ca25c..c28dcb9 100644 --- a/src/commands/install.ts +++ b/src/commands/install.ts @@ -1,12 +1,12 @@ -import * as vscode from 'vscode'; +import * as vscode from "vscode"; import { EXT_NAME } from "../config"; import chan from "../helpers/outputChannel"; import { checkAvm, installAnchorUsingAvm, installAvm } from "../helpers/avm"; +import { checkInstallSolana } from "../helpers/install"; -export const anchorInstall = () => vscode.commands.registerCommand( - `${EXT_NAME}.install`, - async () => { - try{ +export const anchorInstall = () => + vscode.commands.registerCommand(`${EXT_NAME}.install`, async () => { + try { try { await checkAvm(); } catch (err) { @@ -14,10 +14,22 @@ export const anchorInstall = () => vscode.commands.registerCommand( } finally { await installAnchorUsingAvm(); } - } catch(err) { - if(err instanceof Error) { - chan.appendLine(err.message); - chan.show(true); + } catch (err) { + if (err instanceof Error) { + chan.appendLine(err.message); + chan.show(true); + } + } + }); + +export const solanaInstall = () => + vscode.commands.registerCommand(`${EXT_NAME}.solanaInstall`, async () => { + try { + await checkInstallSolana(); + } catch (err) { + if (err instanceof Error) { + chan.appendLine(err.message); + chan.show(true); + } } - }} -); \ No newline at end of file + });