From da552d8536f39e5a44cf6968f7e50cb074954dc6 Mon Sep 17 00:00:00 2001 From: hemarina Date: Tue, 10 Sep 2024 14:38:42 -0700 Subject: [PATCH] make sure it is absolutepath --- ext/azuredevops/setupAzd/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ext/azuredevops/setupAzd/index.ts b/ext/azuredevops/setupAzd/index.ts index 336ef44a051..38e66edcbde 100644 --- a/ext/azuredevops/setupAzd/index.ts +++ b/ext/azuredevops/setupAzd/index.ts @@ -59,7 +59,8 @@ Read more about Azure Developer CLI telemetry: https://github.com/Azure/azure-de console.log(`Installing azd from ${url}`); const buffer = await download(url); const extractedTo = path.join(task.cwd(), "azd-install"); - await decompress(buffer, extractedTo); + const extractedToAbsolutePath = path.resolve(extractedTo); + await decompress(buffer, extractedToAbsolutePath); let binName; if (os !== "win32") { @@ -67,12 +68,15 @@ Read more about Azure Developer CLI telemetry: https://github.com/Azure/azure-de } else { binName = "azd.exe"; } - const binPath = path.join(extractedTo, binName); + const binPath = path.join(extractedToAbsolutePath, binName); // This is not symlinkSync as setup-azd GitHub Action due to Self-Host Agent permission error - fs.copyFileSync(path.join(extractedTo, installArray[1]), binPath); - task.prependPath(extractedTo); - console.log(`azd installed to ${extractedTo}`); + fs.copyFileSync( + path.join(extractedToAbsolutePath, installArray[1]), + binPath + ); + task.prependPath(extractedToAbsolutePath); + console.log(`azd installed to ${extractedToAbsolutePath}`); task.execSync(binPath, "version"); } catch (err: any) {