diff options
| author | mo khan <mo@mokhan.ca> | 2024-06-05 12:03:22 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2024-06-05 12:03:22 -0600 |
| commit | 438702b93b556223c731fc127f8729702b9dd221 (patch) | |
| tree | 6915d07787ea100507322232648e67c3ab3cbb15 | |
| parent | f91092d153673657d44921312f009c0d338a911a (diff) | |
Add mage build target
| -rw-r--r-- | magefile.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/magefile.go b/magefile.go index c7ead27..ac5fa87 100644 --- a/magefile.go +++ b/magefile.go @@ -4,6 +4,10 @@ package main import ( + "fmt" + "os" + + "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" ) @@ -11,6 +15,19 @@ import ( // If not set, running mage will list available targets var Default = Test +// Clean +func Clean() error { + fmt.Println("Cleaning...") + return os.RemoveAll("stanuki") +} + +// Build the CLI +func Build() error { + mg.Deps(Clean) + fmt.Println("Building...") + return sh.RunV("go", "build", "-o", "stanuki", "./cmd/stanuki/main.go") +} + // Run the unit tests func Test() error { return sh.RunV("go", "test", "-v", "./...") |
