Skip to content

Commit

Permalink
fix: path in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Oct 10, 2021
1 parent ef0ecab commit 86acf58
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
project = workspaceFolder.uri.fsPath;
}

// FUCK windows
project = project.replace(/^(\/|\\)?([a-z]):/, ($0, $1, $2) => $2.toUpperCase() + ":");

if (version === undefined) {
version = await vscode.window.showInputBox({
value: "",
Expand Down Expand Up @@ -49,17 +52,17 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>

context.subscriptions.push(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vscode.commands.registerCommand("whatchanged.generate", (item: any) => {
vscode.commands.registerCommand("whatchanged.generate", async (item: any) => {
const project = item?._rootUri?.path ?? undefined;
generate(project);
return generate(project);
})
);

context.subscriptions.push(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vscode.commands.registerCommand("whatchanged.generateAll", (item: any) => {
vscode.commands.registerCommand("whatchanged.generateAll", async (item: any) => {
const project = item?._rootUri?.path ?? undefined;
generate(project, "HEAD~");
return generate(project, "HEAD~");
})
);
}
Expand Down

0 comments on commit 86acf58

Please sign in to comment.