diff --git a/src/Parameters.ts b/src/Parameters.ts index b0f32e3e..711ebc4e 100644 --- a/src/Parameters.ts +++ b/src/Parameters.ts @@ -13,5 +13,16 @@ export interface TelemetryParameters export interface RunnerParameters extends LoggerParameters, TelemetryParameters { workingDir: string; + + // Directory containing unzipped Windows and Linux PAC Nuget Packages. + // Expectation is that, both versions have been renamed such that + // linux PAC executable's path is /pac_linux/tools/pac + // and windows PAC executable's path is \pac\tools\pac.exe + // This should be ignored in favor of pacPath if specified. runnersDir: string; + + // Full path to pac.exe or pac (linux/mac) executable. Used instead of runnersDir if specified, + // for scenarios where PAC is installed in the pipeline instead of included in the + // ADO VSIX or GitHub tarball/zipball + pacPath?: string; } diff --git a/src/pac/createPacRunner.ts b/src/pac/createPacRunner.ts index b0744c98..4b15c948 100644 --- a/src/pac/createPacRunner.ts +++ b/src/pac/createPacRunner.ts @@ -3,11 +3,11 @@ import { resolve } from "path"; import { CommandRunner, createCommandRunner } from "../CommandRunner"; import { RunnerParameters } from "../Parameters"; -export default function createPacRunner({workingDir, runnersDir, logger, agent}: RunnerParameters): CommandRunner +export default function createPacRunner({workingDir, runnersDir, pacPath, logger, agent}: RunnerParameters): CommandRunner { return createCommandRunner( workingDir, - platform() === "win32" + pacPath ?? platform() === "win32" ? resolve(runnersDir, "pac", "tools", "pac.exe") : resolve(runnersDir, "pac_linux", "tools", "pac"), logger,