Skip to content

Commit

Permalink
Merge pull request #606 from reviewdog/bump-nodejs20
Browse files Browse the repository at this point in the history
bump Node.js 20
  • Loading branch information
shogo82148 authored Sep 12, 2023
2 parents 327ed57 + 9e6c6cd commit 24d4af2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 47 deletions.
34 changes: 16 additions & 18 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Run golangci-lint with reviewdog",
"main": "lib/main.js",
"engines": {
"node": ">=16.0.0"
"node": ">=20.0.0"
},
"scripts": {
"build": "tsc",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"devDependencies": {
"@types/jest": "29.5.4",
"@types/node": "16.18.48",
"@types/node": "^20.6.0",
"@types/semver": "7.5.1",
"@typescript-eslint/parser": "5.62.0",
"@vercel/ncc": "0.38.0",
Expand Down
34 changes: 16 additions & 18 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export async function installReviewdog(tag: string, directory: string): Promise<
const version = await tagToVersion(tag, owner, repo);

// get the os information
let platform = process.platform.toString();
let platform: string;
let ext = "";
switch (platform) {
switch (process.platform) {
case "darwin":
platform = "Darwin";
break;
Expand All @@ -23,22 +23,20 @@ export async function installReviewdog(tag: string, directory: string): Promise<
ext = ".exe";
break;
default:
throw new Error(`unsupported platform: ${platform}`);
throw new Error(`unsupported platform: ${process.platform}`);
}

// get the arch information
let arch = process.arch;
switch (arch) {
let arch: string;
switch (process.arch) {
case "x64":
arch = "x86_64";
break;
case "arm64":
break;
case "x32":
arch = "i386";
arch = "arm64";
break;
default:
throw new Error(`unsupported arch: ${arch}`);
throw new Error(`unsupported arch: ${process.arch}`);
}

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

// get the os information
let platform = process.platform.toString();
let platform: string;
let ext = "";
let archive = "tar.gz";
switch (platform) {
switch (process.platform) {
case "darwin":
platform = "darwin";
break;
case "linux":
platform = "linux";
break;
case "win32":
platform = "windows";
ext = ".exe";
archive = "zip";
break;
default:
throw new Error(`unsupported platform: ${platform}`);
throw new Error(`unsupported platform: ${process.platform}`);
}

// get the arch information
let arch = process.arch;
switch (arch) {
let arch: string;
switch (process.arch) {
case "x64":
arch = "amd64";
break;
case "arm64":
break;
case "x32":
arch = "386";
arch = "arm64";
break;
default:
throw new Error(`unsupported arch: ${arch}`);
throw new Error(`unsupported arch: ${process.arch}`);
}

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

0 comments on commit 24d4af2

Please sign in to comment.