Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow linux arm64
Browse files Browse the repository at this point in the history
ldez committed Jan 16, 2025
1 parent d4917a5 commit 9852af7
Showing 4 changed files with 18,925 additions and 599 deletions.
9,757 changes: 9,458 additions & 299 deletions dist/post_run/index.js

Large diffs are not rendered by default.

9,757 changes: 9,458 additions & 299 deletions dist/run/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/install.ts
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ const getAssetURL = (versionConfig: VersionConfig): string => {
}
let arch = os.arch()
switch (arch) {
case "arm64":
arch = "arm64"
break
case "x64":
arch = "amd64"
break
7 changes: 6 additions & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import * as fs from "fs"
import path from "path"

import { InstallMode } from "./install"
import os from "os";

// TODO: make a class
export type Version = {
@@ -139,10 +140,14 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
// if the patched version is passed, just use it
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
return new Promise((resolve) => {
let arch: string = "amd64"
if (os.machine() === "arm64") {
arch = "arm64"
}
const versionWithoutV = `${reqLintVersion.major}.${reqLintVersion.minor}.${reqLintVersion.patch}`
resolve({
TargetVersion: `v${versionWithoutV}`,
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-amd64.tar.gz`,
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-${arch}.tar.gz`,
})
})
}

0 comments on commit 9852af7

Please sign in to comment.