Skip to content

Commit

Permalink
fix: clean go install output (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Sep 12, 2024
1 parent 33f56cc commit c7bab6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dist/post_run/index.js

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

7 changes: 6 additions & 1 deletion dist/run/index.js

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

7 changes: 6 additions & 1 deletion src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down

0 comments on commit c7bab6f

Please sign in to comment.