Compare commits
No commits in common. '876dbbda02b7df680ef92a7249b7493814f6a9a0' and '8333830573affa6fabbcdd3c24280e25e863675b' have entirely different histories.
876dbbda02
...
8333830573
@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
|
|
||||||
$.verbose = false;
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
const catOutput = await $`cat go.mod`;
|
|
||||||
const contents = catOutput.stdout;
|
|
||||||
|
|
||||||
const lines = contents.split("\n");
|
|
||||||
let goVersion = "";
|
|
||||||
for (let line of lines) {
|
|
||||||
if (line.startsWith("go ")) {
|
|
||||||
goVersion = line.substring("go ".length);
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await $`gvm install go${goVersion}`
|
|
||||||
console.log(goVersion)
|
|
||||||
} catch (e) {
|
|
||||||
await $`exit 0`;
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
|
|
||||||
$.verbose = false;
|
|
||||||
|
|
||||||
async function getGoVersion() {
|
|
||||||
const goVersionProcess = await $`go version`;
|
|
||||||
const re = /go version go(.*) /;
|
|
||||||
return re.exec(goVersionProcess.stdout)[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
let gitRoot = await $`git rev-parse --show-toplevel`;
|
|
||||||
gitRoot = gitRoot.stdout.trim();
|
|
||||||
const lintPath = `${gitRoot}/.github/workflows/golangci.yml`;
|
|
||||||
const catOutput = await $`cat ${lintPath}`;
|
|
||||||
const contents = catOutput.stdout;
|
|
||||||
|
|
||||||
let re = /version:\sv(.*)/
|
|
||||||
const targetVersion = re.exec(contents)[1]
|
|
||||||
|
|
||||||
let currentVersion = await $`golangci-lint --version`;
|
|
||||||
re = /golangci-lint has version (.*) built.*/;
|
|
||||||
currentVersion = re.exec(currentVersion.stdout)[1];
|
|
||||||
|
|
||||||
let goVersion = await getGoVersion()
|
|
||||||
goVersion = goVersion.substring(0, 4); // strip off the patch version
|
|
||||||
if (currentVersion !== targetVersion) {
|
|
||||||
await $`curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /Users/chatton/.gvm/pkgsets/go${goVersion}/global/bin v${targetVersion}`
|
|
||||||
console.log("updated to golangci-lint version " + targetVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
await $`exit 0`;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue