summaryrefslogtreecommitdiffstats
path: root/build/code-batch-process.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-03-16 03:50:26 +0100
committerGitHub <noreply@github.com>2022-03-15 22:50:26 -0400
commitfe9626af296f7c7893af8cff88bc4195724bea07 (patch)
tree7a53ba47454d62c52128da1cf9f2ed723af97bbd /build/code-batch-process.go
parent6ab4a96855e472f3a8f86b2e7f66a9cc714fa447 (diff)
downloadgitea-fe9626af296f7c7893af8cff88bc4195724bea07.tar.gz
gitea-fe9626af296f7c7893af8cff88bc4195724bea07.zip
Use `go run` for tool dependencies, require go 1.17 (#18874)
This ensures the tools only run in the versions we've tested and it also does not polute PATH with those tools so they are truly isolated. This syntax of `go run` requires go 1.17, so the minimum version is set accordingly. Fixes: https://github.com/go-gitea/gitea/issues/18867 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'build/code-batch-process.go')
-rw-r--r--build/code-batch-process.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/build/code-batch-process.go b/build/code-batch-process.go
index 8139fe7623..b2290af771 100644
--- a/build/code-batch-process.go
+++ b/build/code-batch-process.go
@@ -40,7 +40,7 @@ func passThroughCmd(cmd string, args []string) error {
}
c := exec.Cmd{
Path: foundCmd,
- Args: args,
+ Args: append([]string{cmd}, args...),
Stdin: os.Stdin,
Stdout: os.Stdout,
Stderr: os.Stderr,
@@ -271,9 +271,9 @@ func main() {
log.Print("the -d option is not supported by gitea-fmt")
}
cmdErrors = append(cmdErrors, giteaFormatGoImports(files, containsString(subArgs, "-l"), containsString(subArgs, "-w")))
- cmdErrors = append(cmdErrors, passThroughCmd("gofumpt", append([]string{"-extra", "-lang", "1.16"}, substArgs...)))
+ cmdErrors = append(cmdErrors, passThroughCmd("go", append([]string{"run", os.Getenv("GOFUMPT_PACKAGE"), "-extra", "-lang", "1.17"}, substArgs...)))
case "misspell":
- cmdErrors = append(cmdErrors, passThroughCmd("misspell", substArgs))
+ cmdErrors = append(cmdErrors, passThroughCmd("go", append([]string{"run", os.Getenv("MISSPELL_PACKAGE")}, substArgs...)))
default:
log.Fatalf("unknown cmd: %s %v", subCmd, subArgs)
}