Merge branch 'main' into feature/extension-settings

This commit is contained in:
Sanjula Ganepola
2024-11-27 20:03:43 -05:00
17 changed files with 358 additions and 130 deletions

View File

@@ -1,6 +1,7 @@
import * as os from "os";
import * as path from "path";
import { ConfigurationTarget, workspace } from 'vscode';
import { Act } from './act';
export enum Platform {
windows = 'win32',
@@ -9,6 +10,7 @@ export enum Platform {
}
export enum Section {
actCommand = 'actCommand',
dockerDesktopPath = 'dockerDesktopPath',
actionCachePath = 'actionCachePath'
}
@@ -17,7 +19,7 @@ export namespace ConfigurationManager {
export const group: string = 'githubLocalActions';
export const searchPrefix: string = '@ext:sanjulaganepola.github-local-actions';
export function initialize(): void {
export async function initialize(): Promise<void> {
let dockerDesktopPath = ConfigurationManager.get<string>(Section.dockerDesktopPath);
if (!dockerDesktopPath) {
switch (process.platform) {
@@ -31,7 +33,12 @@ export namespace ConfigurationManager {
return;
}
ConfigurationManager.set(Section.dockerDesktopPath, dockerDesktopPath);
await ConfigurationManager.set(Section.dockerDesktopPath, dockerDesktopPath);
}
let actCommand = ConfigurationManager.get<string>(Section.actCommand);
if (!actCommand) {
await ConfigurationManager.set(Section.actCommand, Act.defaultActCommand);
}
let actionCachePath = ConfigurationManager.get<string>(Section.actionCachePath);