Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 30243a4

Browse files
committed
拡張子を修正
1 parent 95b600a commit 30243a4

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

index.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,28 @@ const tc = require("@actions/tool-cache");
3939
}
4040
})();
4141

42-
const url = `https://github.com/koki-develop/qiita-cli/releases/download/${version}/qiita_${platform}_${arch}.tar.gz`;
42+
const ext = (() => {
43+
switch (platform) {
44+
case "Windows":
45+
return "zip";
46+
default:
47+
return "tar.gz";
48+
}
49+
})();
50+
51+
const url = `https://github.com/koki-develop/qiita-cli/releases/download/${version}/qiita_${platform}_${arch}.${ext}`;
4352
core.info(`Downloading... ${url}`);
4453
const cliPath = await tc.downloadTool(url);
4554

4655
core.info("Installing...");
47-
const extractedPath = await tc.extractTar(cliPath);
56+
const extractedPath = await (async () => {
57+
switch (ext) {
58+
case "zip":
59+
return tc.extractZip(cliPath);
60+
case "tar.gz":
61+
return tc.extractTar(cliPath);
62+
}
63+
})();
4864
const binPath = await tc.cacheDir(extractedPath, "qiita", "0.1.0");
4965
core.addPath(binPath);
5066
core.info("Installed.");

0 commit comments

Comments
 (0)