public async installPackCliAsync()

in src/ContainerAppHelper.ts [553:574]


    public async installPackCliAsync() {
        toolHelper.writeDebug('Attempting to install the pack CLI');
        try {
            let command: string = '';
            let commandLine = '';
            if (IS_WINDOWS_AGENT) {
                let packZipDownloadUri: string = 'https://github.com/buildpacks/pack/releases/download/v0.31.0/pack-v0.31.0-windows.zip';
                let packZipDownloadFilePath: string = path.join(PACK_CMD, 'pack-windows.zip');
                command = `New-Item -ItemType Directory -Path ${PACK_CMD} -Force | Out-Null; Invoke-WebRequest -Uri ${packZipDownloadUri} -OutFile ${packZipDownloadFilePath}; Expand-Archive -LiteralPath ${packZipDownloadFilePath} -DestinationPath ${PACK_CMD}; Remove-Item -Path ${packZipDownloadFilePath}`;
                commandLine = 'pwsh';
            } else {
                let tgzSuffix = os.platform() == 'darwin' ? 'macos' : 'linux';
                command = `(curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.31.0/pack-v0.31.0-${tgzSuffix}.tgz" | ` +
                    'tar -C /usr/local/bin/ --no-same-owner -xzv pack)';
                commandLine = 'bash';
            }
            await util.execute(`${commandLine} -c "${command}"`);
        } catch (err) {
            toolHelper.writeError(`Unable to install the pack CLI. Error: ${err.message}`);
            throw err;
        }
    }