Skip to content

Commit 6176d56

Browse files
authored
chore(settings): Set GGshielPath in the extension settings (#21)
1 parent 8c2577c commit 6176d56

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib/ggshield-configuration.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ export function setApiKey(configuration: GGShieldConfiguration, apiKey: string |
4242
const config = workspace.getConfiguration("gitguardian");
4343
configuration.apiKey = apiKey ? apiKey : "";
4444
config.update("apiKey", apiKey, ConfigurationTarget.Global);
45+
}
46+
47+
export function setGGShieldPath(configuration: GGShieldConfiguration): void {
48+
const config = workspace.getConfiguration("gitguardian");
49+
50+
config.update("GGShieldPath", configuration.ggshieldPath, ConfigurationTarget.Global);
4551
}

src/lib/ggshield-resolver.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as vscode from "vscode";
22
import {
33
getConfiguration,
44
GGShieldConfiguration,
5+
setGGShieldPath,
56
} from "./ggshield-configuration";
67
import { runGGShieldCommand } from "./ggshield-api";
78
import { window } from "vscode";
@@ -37,6 +38,7 @@ export class GGShieldResolver {
3738
this.channel.appendLine(
3839
`Using ggshield at: ${this.configuration.ggshieldPath}, to change this go to settings.`
3940
);
41+
setGGShieldPath(this.configuration);
4042
return;
4143
} catch (error) {
4244
this.channel.appendLine(

0 commit comments

Comments
 (0)