Skip to content

Commit

Permalink
make sure it is absolutepath
Browse files Browse the repository at this point in the history
  • Loading branch information
hemarina committed Sep 10, 2024
1 parent baf6041 commit da552d8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ext/azuredevops/setupAzd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,24 @@ 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") {
binName = "azd";
} 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) {
Expand Down

0 comments on commit da552d8

Please sign in to comment.