Skip to content

Commit

Permalink
feat: add "Install Hermione" action
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Feb 15, 2024
1 parent f3d6570 commit 3b5391d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# vscode-hermione
Integration Hermione with VS Code

This extension supports [Hermione][hermione] features in VS Code environment. Available features:

- [Install Hermione](#install-hermione)
- [Using the REPL mode][#using-the-repl-mode]

## Install Hermione

If you are not using hermione yet or starting a new testing project, the "Install Hermione" action from the command panel will help you get started.

## Using the REPL mode

Adds a keybinding (`cmd+shift+8` for mac and `ctrl+shift+8` for others) to run a dedicated section of code in the VSCode terminal. More infor about [REPL mode][hermione-repl-mode].

[hermione]: https://github.com/gemini-testing/hermione
[hermione-repl-mode]: https://github.com/gemini-testing/hermione?tab=readme-ov-file#repl-mode
23 changes: 23 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as vscode from "vscode";

export function activate(context: vscode.ExtensionContext): void {
const disposable = vscode.commands.registerCommand("hrm.install", async () => {
const [workspaceFolder] = vscode.workspace.workspaceFolders || [];
if (!workspaceFolder) {
await vscode.window.showErrorMessage("Open a folder in VS Code to initialize Hermione");
return;
}

const terminal = vscode.window.createTerminal({
name: "Install Hermione",
cwd: workspaceFolder.uri.fsPath,
env: process.env,
});

terminal.show();

terminal.sendText(`npm init hermione-app -- --yes`, true);
});

context.subscriptions.push(disposable);
}

0 comments on commit 3b5391d

Please sign in to comment.