Skip to content

Commit c7bab6f

Browse files
authored
fix: clean go install output (#1102)
1 parent 33f56cc commit c7bab6f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

dist/post_run/index.js

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

dist/run/index.js

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

src/install.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ export async function goInstall(versionConfig: VersionConfig): Promise<string> {
101101
printOutput(res)
102102

103103
// The output of `go install -n` when the binary is already installed is `touch <path_to_the_binary>`.
104-
const lintPath = res.stderr.trimStart().trimEnd().split(` `, 2)[1]
104+
const lintPath = res.stderr
105+
.split(/\r?\n/)
106+
.map((v) => v.trimStart().trimEnd())
107+
.filter((v) => v.startsWith("touch "))
108+
.reduce((a, b) => a + b, "")
109+
.split(` `, 2)[1]
105110

106111
core.info(`Installed golangci-lint into ${lintPath} in ${Date.now() - startedAt}ms`)
107112

0 commit comments

Comments
 (0)