summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/Magefile.go b/Magefile.go
index b4ec4e7..44cfeee 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -21,12 +21,27 @@ func run(cmd string, args ...string) error {
return c.Run()
}
+// Default runs the program.
+func Default() error {
+ return Run()
+}
+
// Build compiles the binary.
func Build() error {
fmt.Println("building...")
return run("go", "build", "-o", binName, "./cmd/gonf")
}
+
+// Run builds and runs the program.
+func Run() error {
+ fmt.Println("running...")
+ if err := Build(); err != nil {
+ return err
+ }
+ return run("./"+binName, "version")
+}
+
// Test runs all unit tests.
func Test() error {
fmt.Println("testing...")