supabase-operator/magefiles/commands.go
Peter Kurfer 12090c913a
Some checks failed
E2E Tests / Run on Ubuntu (push) Failing after 20s
Lint / Run on Ubuntu (push) Failing after 3m45s
Tests / Run on Ubuntu (push) Failing after 16m8s
feat(db): prepare migrations and core CRD
2024-12-13 09:09:14 +01:00

31 lines
731 B
Go

package main
import (
"github.com/magefile/mage/sh"
)
type command string
var (
ControllerGen = command("controller-gen")
Gofumpt = command("gofumpt")
GolangciLint = command("golangci-lint")
)
var tools map[command]string = map[command]string{
ControllerGen: "sigs.k8s.io/controller-tools/cmd/controller-gen",
Gofumpt: "mvdan.cc/gofumpt",
GolangciLint: "github.com/golangci/golangci-lint/cmd/golangci-lint",
}
var (
Go = sh.RunCmd("go")
Git = sh.RunCmd("git")
RunTool = RunVCmd("go", "run", "-modfile=tools/go.mod")
)
func RunVCmd(cmd string, primaryArgs ...string) func(args ...string) error {
return func(args ...string) error {
return sh.RunV(cmd, append(primaryArgs, args...)...)
}
}