Commit 438702b

mo khan <mo@mokhan.ca>
2024-06-05 18:03:22
Add mage build target
1 parent f91092d
Changed files (1)
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", "./...")