diff --git a/.github/workflows/validate-orchestrator-integration.yml b/.github/workflows/validate-orchestrator-integration.yml index ec2ec1a0..88bf4850 100644 --- a/.github/workflows/validate-orchestrator-integration.yml +++ b/.github/workflows/validate-orchestrator-integration.yml @@ -95,7 +95,7 @@ jobs: - name: Run plugin interface unit tests run: | echo "Running orchestrator-plugin unit tests..." - npx jest orchestrator-plugin --verbose --detectOpenHandles --forceExit + npx vitest run orchestrator-plugin --reporter=verbose - name: Build and pack orchestrator working-directory: orchestrator-standalone @@ -167,6 +167,10 @@ jobs: continue-on-error: true id: orch-branch + - name: Clean corrupted checkout + if: steps.orch-branch.outcome == 'failure' + run: rm -rf .git || true + - name: Fallback to orchestrator main branch if: steps.orch-branch.outcome == 'failure' uses: actions/checkout@v4 @@ -320,9 +324,20 @@ jobs: - name: Run orchestrator unit tests (fast, no infra) timeout-minutes: 2 run: >- - yarn run test - --testPathPattern="orchestrator-guid|orchestrator-folders|task-parameter-serializer|follow-log-stream-service|runner-availability-service|provider-url-parser|provider-loader|provider-git-manager|orchestrator-image|orchestrator-hooks|orchestrator-github-checks|middleware-service" - --verbose --detectOpenHandles --forceExit --runInBand + yarn vitest run + "orchestrator-guid" + "orchestrator-folders" + "task-parameter-serializer" + "follow-log-stream-service" + "runner-availability-service" + "provider-url-parser" + "provider-loader" + "provider-git-manager" + "orchestrator-image" + "orchestrator-hooks" + "orchestrator-github-checks" + "middleware-service" + --reporter=verbose --no-file-parallelism # --- K8s cluster setup --- - name: Clean up disk space before K8s tests @@ -372,7 +387,7 @@ jobs: # --- K8s Test 1: orchestrator-image --- - name: Run orchestrator-image test (K8s) timeout-minutes: 10 - run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-image" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -396,7 +411,7 @@ jobs: # --- K8s Test 2: orchestrator-kubernetes --- - name: Run orchestrator-kubernetes test timeout-minutes: 30 - run: yarn run test "orchestrator-kubernetes" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-kubernetes" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -428,7 +443,7 @@ jobs: # --- K8s Test 3: orchestrator-s3-steps --- - name: Run orchestrator-s3-steps test (K8s) timeout-minutes: 30 - run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-s3-steps" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -461,7 +476,7 @@ jobs: - name: Run orchestrator-end2end-caching test (K8s) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -500,7 +515,7 @@ jobs: - name: Run orchestrator-end2end-retaining test (K8s) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-retaining" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-retaining" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -560,6 +575,10 @@ jobs: continue-on-error: true id: orch-branch + - name: Clean corrupted checkout + if: steps.orch-branch.outcome == 'failure' + run: rm -rf .git || true + - name: Fallback to orchestrator main branch if: steps.orch-branch.outcome == 'failure' uses: actions/checkout@v4 @@ -650,7 +669,7 @@ jobs: # --- AWS Test 1: orchestrator-image --- - name: Run orchestrator-image test (AWS) timeout-minutes: 10 - run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-image" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -668,7 +687,7 @@ jobs: # --- AWS Test 2: orchestrator-environment --- - name: Run orchestrator-environment test (AWS) timeout-minutes: 30 - run: yarn run test "orchestrator-environment" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-environment" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -686,7 +705,7 @@ jobs: # --- AWS Test 3: orchestrator-s3-steps --- - name: Run orchestrator-s3-steps test (AWS) timeout-minutes: 30 - run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-s3-steps" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -704,7 +723,7 @@ jobs: # --- AWS Test 4: orchestrator-hooks --- - name: Run orchestrator-hooks test (AWS) timeout-minutes: 30 - run: yarn run test "orchestrator-hooks" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-hooks" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -722,7 +741,7 @@ jobs: # --- AWS Test 5: orchestrator-caching --- - name: Run orchestrator-caching test (AWS) timeout-minutes: 60 - run: yarn run test "orchestrator-caching" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-caching" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -740,7 +759,7 @@ jobs: # --- AWS Test 6: orchestrator-locking-core --- - name: Run orchestrator-locking-core test (AWS) timeout-minutes: 60 - run: yarn run test "orchestrator-locking-core" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-locking-core" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -758,7 +777,7 @@ jobs: # --- AWS Test 7: orchestrator-locking-get-locked --- - name: Run orchestrator-locking-get-locked test (AWS) timeout-minutes: 60 - run: yarn run test "orchestrator-locking-get-locked" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-locking-get-locked" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -782,7 +801,7 @@ jobs: - name: Run orchestrator-end2end-caching test (AWS) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -801,7 +820,7 @@ jobs: - name: Run orchestrator-end2end-retaining test (AWS) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-retaining" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-retaining" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -820,7 +839,7 @@ jobs: - name: Run orchestrator-end2end-locking test (AWS) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-locking" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-locking" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -865,6 +884,10 @@ jobs: continue-on-error: true id: orch-branch + - name: Clean corrupted checkout + if: steps.orch-branch.outcome == 'failure' + run: rm -rf .git || true + - name: Fallback to orchestrator main branch if: steps.orch-branch.outcome == 'failure' uses: actions/checkout@v4 @@ -954,7 +977,7 @@ jobs: # --- Local Docker Test 1: orchestrator-image --- - name: Run orchestrator-image test (local-docker) timeout-minutes: 10 - run: yarn run test "orchestrator-image" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-image" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -972,7 +995,7 @@ jobs: # --- Local Docker Test 2: orchestrator-hooks --- - name: Run orchestrator-hooks test (local-docker) timeout-minutes: 30 - run: yarn run test "orchestrator-hooks" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-hooks" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -990,7 +1013,7 @@ jobs: # --- Local Docker Test 3: orchestrator-local-persistence --- - name: Run orchestrator-local-persistence test (local-docker) timeout-minutes: 30 - run: yarn run test "orchestrator-local-persistence" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-local-persistence" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1008,7 +1031,7 @@ jobs: # --- Local Docker Test 4: orchestrator-caching --- - name: Run orchestrator-caching test (local-docker) timeout-minutes: 30 - run: yarn run test "orchestrator-caching" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-caching" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1026,7 +1049,7 @@ jobs: # --- Local Docker Test 5: orchestrator-github-checks --- - name: Run orchestrator-github-checks test (local-docker) timeout-minutes: 30 - run: yarn run test "orchestrator-github-checks" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-github-checks" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1044,7 +1067,7 @@ jobs: # --- Local Docker Test 6: orchestrator-locking-core (with S3) --- - name: Run orchestrator-locking-core test (local-docker + S3) timeout-minutes: 30 - run: yarn run test "orchestrator-locking-core" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-locking-core" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1062,7 +1085,7 @@ jobs: # --- Local Docker Test 7: orchestrator-locking-get-locked (with S3) --- - name: Run orchestrator-locking-get-locked test (local-docker + S3) timeout-minutes: 30 - run: yarn run test "orchestrator-locking-get-locked" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-locking-get-locked" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1080,7 +1103,7 @@ jobs: # --- Local Docker Test 8: orchestrator-s3-steps (with S3) --- - name: Run orchestrator-s3-steps test (local-docker + S3) timeout-minutes: 30 - run: yarn run test "orchestrator-s3-steps" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-s3-steps" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1099,7 +1122,7 @@ jobs: - name: Run orchestrator-end2end-caching test (local-docker + S3) timeout-minutes: 60 continue-on-error: true - run: yarn run test "orchestrator-end2end-caching" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-end2end-caching" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} @@ -1144,6 +1167,10 @@ jobs: continue-on-error: true id: orch-branch + - name: Clean corrupted checkout + if: steps.orch-branch.outcome == 'failure' + run: rm -rf .git || true + - name: Fallback to orchestrator main branch if: steps.orch-branch.outcome == 'failure' uses: actions/checkout@v4 @@ -1220,7 +1247,7 @@ jobs: # --- Rclone Test --- - name: Run orchestrator-rclone-steps test timeout-minutes: 30 - run: yarn run test "orchestrator-rclone-steps" --detectOpenHandles --forceExit --runInBand + run: yarn run test "orchestrator-rclone-steps" --no-file-parallelism env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} diff --git a/action.yml b/action.yml index d895aa3a..56a722fe 100644 --- a/action.yml +++ b/action.yml @@ -178,6 +178,11 @@ inputs: default: 'false' required: false description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.' + linux64RemoveExecutableExtension: + default: 'false' + required: false + description: + 'When building for StandaloneLinux64, remove the default file extension of `.x86_64`. Set to true to restore the extensionless behavior from v4.' outputs: volume: diff --git a/package.json b/package.json index daf7dee5..29789ce3 100644 --- a/package.json +++ b/package.json @@ -32,19 +32,16 @@ "node": ">=18.x" }, "dependencies": { - "@actions/cache": "^4.0.0", + "@actions/cache": "^4.1.0", "@actions/core": "^1.11.1", "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", - "commander": "^9.0.0", - "commander-ts": "^0.2.0", + "@actions/github": "^6.0.1", "md5": "^2.3.0", - "nanoid": "^3.3.1", - "reflect-metadata": "^0.1.13", - "semver": "^7.5.2", + "nanoid": "^3.3.12", + "semver": "^7.7.4", "ts-md5": "^1.3.1", "unity-changeset": "^3.1.0", - "yaml": "^2.2.2" + "yaml": "^2.8.4" }, "devDependencies": { "@types/node": "^17.0.23", diff --git a/src/index-plugin-features.test.ts b/src/index-plugin-features.test.ts index c5dbfe75..ccd3dbd9 100644 --- a/src/index-plugin-features.test.ts +++ b/src/index-plugin-features.test.ts @@ -66,12 +66,6 @@ vi.mock('./model', () => ({ }, })); -vi.mock('./model/cli/cli', () => ({ - Cli: { - InitCliMode: vi.fn().mockReturnValue(false), - }, -})); - vi.mock('./model/mac-builder', () => ({ __esModule: true, default: { diff --git a/src/index.ts b/src/index.ts index a45974a8..cec5070e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ import * as core from '@actions/core'; import { Action, BuildParameters, Cache, Docker, ImageTag, Output } from './model'; -import { Cli } from './model/cli/cli'; import MacBuilder from './model/mac-builder'; import PlatformSetup from './model/platform-setup'; import { Plugin, loadPlugin } from './model/plugin'; @@ -9,11 +8,6 @@ import { Plugin, loadPlugin } from './model/plugin'; // vitest's module re-loading (which changed in vitest 4). export async function runMain() { try { - if (Cli.InitCliMode()) { - await Cli.RunCli(); - - return; - } Action.checkCompatibility(); Cache.verify(); diff --git a/src/model/build-parameters.test.ts b/src/model/build-parameters.test.ts index e669bcad..c7f4470d 100644 --- a/src/model/build-parameters.test.ts +++ b/src/model/build-parameters.test.ts @@ -117,18 +117,21 @@ describe('BuildParameters', () => { }); test.each` - targetPlatform | expectedExtension | androidExportType - ${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} - ${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} - ${Platform.types.Android} | ${''} | ${'androidStudioProject'} - ${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} - ${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} + targetPlatform | expectedExtension | androidExportType | linux64RemoveExecutableExtension + ${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} | ${false} + ${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} | ${true} + ${Platform.types.Android} | ${''} | ${'androidStudioProject'} | ${false} + ${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} | ${true} + ${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} | ${false} + ${Platform.types.StandaloneLinux64} | ${'.x86_64'} | ${'n/a'} | ${false} + ${Platform.types.StandaloneLinux64} | ${''} | ${'n/a'} | ${true} `( - 'appends $expectedExtension for $targetPlatform with androidExportType $androidExportType', - async ({ targetPlatform, expectedExtension, androidExportType }) => { + 'appends $expectedExtension for $targetPlatform with linux64RemoveExecutableExtension=$linux64RemoveExecutableExtension', + async ({ targetPlatform, expectedExtension, androidExportType, linux64RemoveExecutableExtension }) => { vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform); vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform); vi.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType); + vi.spyOn(Input, 'linux64RemoveExecutableExtension', 'get').mockReturnValue(linux64RemoveExecutableExtension); await expect(BuildParameters.create()).resolves.toEqual( expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }), ); diff --git a/src/model/build-parameters.ts b/src/model/build-parameters.ts index e19d55f7..ebf752d1 100644 --- a/src/model/build-parameters.ts +++ b/src/model/build-parameters.ts @@ -6,7 +6,7 @@ import UnityVersioning from './unity-versioning'; import Versioning from './versioning'; import { GitRepoReader } from './input-readers/git-repo'; import { GithubCliReader } from './input-readers/github-cli'; -import { Cli } from './cli/cli'; +import { PluginOptions } from './plugin-options'; import GitHub from './github'; import * as core from '@actions/core'; @@ -73,6 +73,7 @@ class BuildParameters { Input.buildName, Input.targetPlatform, Input.androidExportType, + Input.linux64RemoveExecutableExtension, ); const editorVersion = UnityVersioning.determineUnityVersion( Input.projectPath, @@ -128,7 +129,7 @@ class BuildParameters { } const providerStrategy = - Input.getInput('providerStrategy') || (Cli.isCliMode ? 'aws' : 'local'); + Input.getInput('providerStrategy') || (PluginOptions.isPluginMode ? 'aws' : 'local'); return { editorVersion, @@ -181,14 +182,19 @@ class BuildParameters { '0123456789abcdefghijklmnopqrstuvwxyz', 4, )()}`, - isCliMode: Cli.isCliMode, + isCliMode: PluginOptions.isPluginMode, cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac, unityHubVersionOnMac: Input.unityHubVersionOnMac, dockerWorkspacePath: Input.dockerWorkspacePath, }; } - static parseBuildFile(filename: string, platform: string, androidExportType: string): string { + static parseBuildFile( + filename: string, + platform: string, + androidExportType: string, + linux64RemoveExecutableExtension: boolean, + ): string { if (Platform.isWindows(platform)) { return `${filename}.exe`; } @@ -208,6 +214,10 @@ class BuildParameters { } } + if (platform === Platform.types.StandaloneLinux64 && !linux64RemoveExecutableExtension) { + return `${filename}.x86_64`; + } + return filename; } diff --git a/src/model/cli/cli-functions-repository.ts b/src/model/cli/cli-functions-repository.ts deleted file mode 100644 index 62d119cf..00000000 --- a/src/model/cli/cli-functions-repository.ts +++ /dev/null @@ -1,45 +0,0 @@ -export class CliFunctionsRepository { - private static targets: any[] = []; - public static PushCliFunction( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - key: string, - description: string, - ) { - CliFunctionsRepository.targets.push({ - target, - propertyKey, - descriptor, - key, - description, - }); - } - - public static GetCliFunctions(key: any) { - const results = CliFunctionsRepository.targets.find((x) => x.key === key); - if (results === undefined || results.length === 0) { - throw new Error(`no CLI mode found for ${key}`); - } - - return results; - } - - public static GetAllCliModes() { - return CliFunctionsRepository.targets.map((x) => { - return { - key: x.key, - description: x.description, - }; - }); - } - - // eslint-disable-next-line no-unused-vars - public static PushCliFunctionSource(cliFunction: any) {} -} - -export function CliFunction(key: string, description: string) { - return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { - CliFunctionsRepository.PushCliFunction(target, propertyKey, descriptor, key, description); - }; -} diff --git a/src/model/cli/cli.ts b/src/model/cli/cli.ts deleted file mode 100644 index 356e22fa..00000000 --- a/src/model/cli/cli.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Command } from 'commander-ts'; -import { Input } from '..'; -import * as core from '@actions/core'; -import { ActionYamlReader } from '../input-readers/action-yaml'; -import { CliFunction, CliFunctionsRepository } from './cli-functions-repository'; -import { OptionValues } from 'commander'; -import { InputKey } from '../input'; - -export class Cli { - public static options: OptionValues | undefined; - static get isCliMode() { - return Cli.options !== undefined && Cli.options.mode !== undefined && Cli.options.mode !== ''; - } - public static query(key: string, alternativeKey: string) { - if (Cli.options && Cli.options[key] !== undefined) { - return Cli.options[key]; - } - if (Cli.options && alternativeKey && Cli.options[alternativeKey] !== undefined) { - return Cli.options[alternativeKey]; - } - - return; - } - - public static InitCliMode() { - const program = new Command(); - program.version('0.0.1'); - - const actionYamlReader: ActionYamlReader = new ActionYamlReader(); - const properties = Object.getOwnPropertyNames(Input).filter( - (p) => p !== 'length' && p !== 'prototype' && p !== 'name', - ); - for (const element of properties) { - program.option(`--${element} <${element}>`, actionYamlReader.GetActionYamlValue(element)); - } - program.option( - '-m, --mode ', - CliFunctionsRepository.GetAllCliModes() - .map((x) => `${x.key} (${x.description})`) - .join(` | `), - ); - program.option( - '--populateOverride ', - 'should use override query to pull input false by default', - ); - program.option('--cachePushFrom ', 'cache push from source folder'); - program.option('--cachePushTo ', 'cache push to caching folder'); - program.option('--artifactName ', 'caching artifact name'); - program.option('--select