Skip to content

Commit 681f446

Browse files
Download archive as .tar.gz on win/mac, .zip on windows
1 parent 32997b1 commit 681f446

2 files changed

Lines changed: 295 additions & 197 deletions

File tree

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ export async function installNitro(version: string) {
6969
let toolPath = tc.find(toolName, version);
7070

7171
if (!toolPath) {
72-
const downloadUrl = `https://github.com/ChilliCream/graphql-platform/releases/download/${version}/nitro-${osType}-${archType}.zip`;
72+
const extension = osType === "win" ? "zip" : "tar.gz";
73+
const downloadUrl = `https://github.com/ChilliCream/graphql-platform/releases/download/${version}/nitro-${osType}-${archType}.${extension}`;
7374

7475
core.info(`Downloading Nitro CLI from: ${downloadUrl}`);
7576

7677
const downloadPath = await tc.downloadTool(downloadUrl);
7778

78-
const extractPath = await tc.extractZip(downloadPath);
79+
const extractPath =
80+
osType === "win"
81+
? await tc.extractZip(downloadPath)
82+
: await tc.extractTar(downloadPath);
7983

8084
toolPath = await tc.cacheDir(extractPath, toolName, version);
8185
}

0 commit comments

Comments
 (0)