Skip to content

Commit 24d4af2

Browse files
authored
Merge pull request #606 from reviewdog/bump-nodejs20
bump Node.js 20
2 parents 327ed57 + 9e6c6cd commit 24d4af2

File tree

5 files changed

+43
-47
lines changed

5 files changed

+43
-47
lines changed

dist/index.js

+16-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Run golangci-lint with reviewdog",
66
"main": "lib/main.js",
77
"engines": {
8-
"node": ">=16.0.0"
8+
"node": ">=20.0.0"
99
},
1010
"scripts": {
1111
"build": "tsc",
@@ -37,7 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@types/jest": "29.5.4",
40-
"@types/node": "16.18.48",
40+
"@types/node": "^20.6.0",
4141
"@types/semver": "7.5.1",
4242
"@typescript-eslint/parser": "5.62.0",
4343
"@vercel/ncc": "0.38.0",

src/installer.ts

+16-18
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export async function installReviewdog(tag: string, directory: string): Promise<
99
const version = await tagToVersion(tag, owner, repo);
1010

1111
// get the os information
12-
let platform = process.platform.toString();
12+
let platform: string;
1313
let ext = "";
14-
switch (platform) {
14+
switch (process.platform) {
1515
case "darwin":
1616
platform = "Darwin";
1717
break;
@@ -23,22 +23,20 @@ export async function installReviewdog(tag: string, directory: string): Promise<
2323
ext = ".exe";
2424
break;
2525
default:
26-
throw new Error(`unsupported platform: ${platform}`);
26+
throw new Error(`unsupported platform: ${process.platform}`);
2727
}
2828

2929
// get the arch information
30-
let arch = process.arch;
31-
switch (arch) {
30+
let arch: string;
31+
switch (process.arch) {
3232
case "x64":
3333
arch = "x86_64";
3434
break;
3535
case "arm64":
36-
break;
37-
case "x32":
38-
arch = "i386";
36+
arch = "arm64";
3937
break;
4038
default:
41-
throw new Error(`unsupported arch: ${arch}`);
39+
throw new Error(`unsupported arch: ${process.arch}`);
4240
}
4341

4442
const url = `https://github.com/${owner}/${repo}/releases/download/v${version}/reviewdog_${version}_${platform}_${arch}.tar.gz`;
@@ -56,36 +54,36 @@ export async function installGolangciLint(tag: string, directory: string): Promi
5654
const version = await tagToVersion(tag, owner, repo);
5755

5856
// get the os information
59-
let platform = process.platform.toString();
57+
let platform: string;
6058
let ext = "";
6159
let archive = "tar.gz";
62-
switch (platform) {
60+
switch (process.platform) {
6361
case "darwin":
62+
platform = "darwin";
6463
break;
6564
case "linux":
65+
platform = "linux";
6666
break;
6767
case "win32":
6868
platform = "windows";
6969
ext = ".exe";
7070
archive = "zip";
7171
break;
7272
default:
73-
throw new Error(`unsupported platform: ${platform}`);
73+
throw new Error(`unsupported platform: ${process.platform}`);
7474
}
7575

7676
// get the arch information
77-
let arch = process.arch;
78-
switch (arch) {
77+
let arch: string;
78+
switch (process.arch) {
7979
case "x64":
8080
arch = "amd64";
8181
break;
8282
case "arm64":
83-
break;
84-
case "x32":
85-
arch = "386";
83+
arch = "arm64";
8684
break;
8785
default:
88-
throw new Error(`unsupported arch: ${arch}`);
86+
throw new Error(`unsupported arch: ${process.arch}`);
8987
}
9088

9189
const url = `https://github.com/${owner}/${repo}/releases/download/v${version}/golangci-lint-${version}-${platform}-${arch}.${archive}`;

0 commit comments

Comments
 (0)