Skip to content

Commit

Permalink
Import getCreatorVersion from utils file
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikdps committed Dec 17, 2024
1 parent 3fe9f37 commit 9a4285c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ ignore:
- src/webview/apps/contentCreator/createAnsibleCollectionPageApp.ts
- src/webview/apps/contentCreator/createAnsibleProjectPageApp.ts
- src/webview/apps/contentCreator/createDevfilePageApp.ts
- src/webview/apps/contentCreator/createSampleExecutionEnvPageApp.ts
- src/webview/apps/welcomePage/welcomePageApp.ts
- src/webview/apps/quickLinks/quickLinksApp.ts
12 changes: 2 additions & 10 deletions src/features/contentCreator/createSampleExecutionEnvPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getNonce } from "../utils/getNonce";
import { AnsibleSampleExecutionEnvInterface, PostMessageEvent } from "./types";
import { withInterpreter } from "../utils/commandRunner";
import { SettingsManager } from "../../settings";
import { expandPath, getBinDetail, runCommand } from "./utils";
import { expandPath, runCommand, getCreatorVersion } from "./utils";
import { ANSIBLE_CREATOR_EE_VERSION_MIN } from "../../definitions/constants";

export class CreateSampleExecutionEnv {
Expand Down Expand Up @@ -276,14 +276,6 @@ export class CreateSampleExecutionEnv {
);
}

private async getCreatorVersion(): Promise<string> {
const creatorVersion = (
await getBinDetail("ansible-creator", "--version")
).toString();
console.log("ansible-creator version: ", creatorVersion);
return creatorVersion;
}

public async getCreatorCommand(url: string): Promise<string> {
let command = "";

Expand Down Expand Up @@ -395,7 +387,7 @@ export class CreateSampleExecutionEnv {
let commandResult: string;

commandOutput += `------------------------------------ ansible-creator logs ------------------------------------\n`;
const creatorVersion = await this.getCreatorVersion();
const creatorVersion = await getCreatorVersion();
if (semver.gte(creatorVersion, ANSIBLE_CREATOR_EE_VERSION_MIN)) {
// execute ansible-creator command
const ansibleCreatorExecutionResult = await runCommand(command, env);
Expand Down

0 comments on commit 9a4285c

Please sign in to comment.