Skip to content

Commit

Permalink
pros c reset button
Browse files Browse the repository at this point in the history
Works
  • Loading branch information
Jackman3323 committed May 20, 2024
1 parent c55104d commit 4a0f170
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ export * from "./set-team-number";
export * from "./set-robot-name";
export * from "./runvision";
export * from "./info-project";
export * from "./reset-conductor";
18 changes: 18 additions & 0 deletions src/commands/reset-conductor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as vscode from "vscode";
import { BaseCommand, BaseCommandOptions } from "./base-command";

export const resetConductor = async () => {
const resetConductorCommandOptions: BaseCommandOptions = {
command: "pros",
args: ["c", "reset"], //--force not needed: Ben's base-commands class auto-handles warning + confirmation.
message: "Resetting Conductor",
requiresProsProject: true,
successMessage: "Conductor Reset Successfully. Any templates and/or depots previously cached will need to be re-fetched.",
};
const resetConductorCommand: BaseCommand = new BaseCommand(resetConductorCommandOptions);
try {
await resetConductorCommand.runCommand();
} catch (err: any) {
await vscode.window.showErrorMessage(err.message);
}
};
2 changes: 2 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
setRobotName,
runVision,
getCurrentKernelOkapiVersion,
resetConductor,
} from "./commands";
import { ProsProjectEditorProvider } from "./views/editor";
import { Analytics } from "./ga";
Expand Down Expand Up @@ -229,6 +230,7 @@ export async function activate(context: vscode.ExtensionContext) {
setupCommandBlocker("pros.upgrade", upgradeProject);
setupCommandBlocker("pros.new", createNewProject);
setupCommandBlocker("pros.infoProject", infoProject);
setupCommandBlocker("pros.resetConductor", resetConductor);

// Beta commands (notice the fourth argument is set to true for these)
setupCommandBlocker("pros.installVision", installVision, context, true);
Expand Down
1 change: 1 addition & 0 deletions src/views/tree-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class TreeDataProvider implements vscode.TreeDataProvider<TreeItem> {
new TreeItem("Upgrade Project", undefined, "pros.upgrade"),
new TreeItem("Create Project", undefined, "pros.new"),
new TreeItem("Project/Template Info", undefined, "pros.infoProject"),
new TreeItem("Reset Conductor", undefined, "pros.resetConductor"),
// open branchline will go here in the future
]),
new TreeItem("Manage Installations", [
Expand Down

0 comments on commit 4a0f170

Please sign in to comment.