Add getActCommand
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
12
src/act.ts
12
src/act.ts
@@ -68,7 +68,7 @@ export interface CommandArgs {
|
||||
|
||||
export class Act {
|
||||
static command: string = 'act';
|
||||
static githubCliCommand: string = 'act';
|
||||
static githubCliCommand: string = 'gh act';
|
||||
context: ExtensionContext;
|
||||
storageManager: StorageManager;
|
||||
secretManager: SecretManager;
|
||||
@@ -216,6 +216,10 @@ export class Act {
|
||||
});
|
||||
}
|
||||
|
||||
static getActCommand() {
|
||||
return ConfigurationManager.get<string>(Section.actCommand) || Act.command;
|
||||
}
|
||||
|
||||
async runAllWorkflows(workspaceFolder: WorkspaceFolder) {
|
||||
return await this.runCommand({
|
||||
path: workspaceFolder.uri.fsPath,
|
||||
@@ -307,7 +311,7 @@ export class Act {
|
||||
} catch (error: any) { }
|
||||
|
||||
// Build command with settings
|
||||
const actCommand = ConfigurationManager.get<string>(Section.actCommand) || Act.command;
|
||||
const actCommand = Act.getActCommand();
|
||||
const settings = await this.settingsManager.getSettings(workspaceFolder, true);
|
||||
const command =
|
||||
`set -o pipefail; ` +
|
||||
@@ -391,9 +395,9 @@ export class Act {
|
||||
});
|
||||
|
||||
if (command.includes('gh-act')) {
|
||||
ConfigurationManager.set(Section.actCommand, Act.command);
|
||||
} else {
|
||||
ConfigurationManager.set(Section.actCommand, Act.githubCliCommand);
|
||||
} else {
|
||||
ConfigurationManager.set(Section.actCommand, Act.command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as childProcess from "child_process";
|
||||
import { commands, env, extensions, QuickPickItemKind, ShellExecution, TaskGroup, TaskPanelKind, TaskRevealKind, tasks, TaskScope, ThemeIcon, Uri, window } from "vscode";
|
||||
import { Act } from "./act";
|
||||
import { ConfigurationManager, Platform, Section } from "./configurationManager";
|
||||
import { act, componentsTreeDataProvider } from "./extension";
|
||||
import ComponentsTreeDataProvider from "./views/components/componentsTreeDataProvider";
|
||||
@@ -33,7 +34,7 @@ export class ComponentsManager {
|
||||
async getComponents(): Promise<Component<CliStatus | ExtensionStatus>[]> {
|
||||
const components: Component<CliStatus | ExtensionStatus>[] = [];
|
||||
|
||||
const actCliInfo = await this.getCliInfo('act --version', /act version (.+)/, false, false);
|
||||
const actCliInfo = await this.getCliInfo(`${Act.getActCommand()} --version`, /act version (.+)/, false, false);
|
||||
components.push({
|
||||
name: 'nektos/act',
|
||||
icon: 'terminal',
|
||||
|
||||
Reference in New Issue
Block a user