35 lines
450 B
Go
35 lines
450 B
Go
//+build mage
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/magefile/mage/sh"
|
|
)
|
|
|
|
var Default = Build
|
|
|
|
var binary = "helix"
|
|
|
|
func Clean() error {
|
|
var err error
|
|
|
|
if err = sh.Run("go", "clean", "./..."); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = os.Remove(binary); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func Test() error {
|
|
return sh.Run("go", "test", ".")
|
|
}
|
|
|
|
func Build() error {
|
|
return sh.Run("go", "build", "-o", binary, "cmd/helix/main.go")
|
|
}
|