fix: clean go install output (#1102)

This commit is contained in:
Ludovic Fernandez
2024-09-13 00:04:49 +02:00
committed by GitHub
parent 33f56cc1ef
commit c7bab6f874
3 changed files with 18 additions and 3 deletions

View File

@ -101,7 +101,12 @@ export async function goInstall(versionConfig: VersionConfig): Promise<string> {
printOutput(res)
// The output of `go install -n` when the binary is already installed is `touch <path_to_the_binary>`.
const lintPath = res.stderr.trimStart().trimEnd().split(` `, 2)[1]
const lintPath = res.stderr
.split(/\r?\n/)
.map((v) => v.trimStart().trimEnd())
.filter((v) => v.startsWith("touch "))
.reduce((a, b) => a + b, "")
.split(` `, 2)[1]
core.info(`Installed golangci-lint into ${lintPath} in ${Date.now() - startedAt}ms`)