Skip to content
Snippets Groups Projects

feat-launch_challenge_commands

2 files
+ 9
4
Compare changes
  • Side-by-side
  • Inline

Files

@@ -8,7 +8,9 @@ import { extensionLog } from '../recorder/utils/log';
export class CommandTreeProvider implements TreeDataProvider<MissionCommand> {
challenge: ChallengeYaml;
constructor() {
context: vscode.ExtensionContext;
constructor(context: vscode.ExtensionContext) {
this.context = context;
if (isDocker()) {
this.challenge = parse(readFileSync('/deadlock/challenge.yaml', 'utf8'));
} else {
@@ -36,13 +38,16 @@ class MissionCommand extends TreeItem {
this.missionCommandYaml = missionCommandYaml;
this.tooltip = missionCommandYaml.description;
this.description = missionCommandYaml.description;
// this.iconPath
this.iconPath = new vscode.ThemeIcon('notebook-execute', new vscode.ThemeColor('debugIcon.startForeground'));
vscode.commands.registerCommand(missionCommandYaml.name, () => {
const terminalName = `Deadlock`;
extensionLog(JSON.stringify(vscode.window.terminals));
const terminal =
vscode.window.terminals.filter((terminal) => terminal.name === terminalName)[0] ??
vscode.window.createTerminal({ cwd: process.env.WORKDIR, name: terminalName });
vscode.window.createTerminal({
cwd: process.env.WORKDIR,
name: terminalName,
});
terminal.sendText(missionCommandYaml.command);
terminal.show();
});
Loading