summaryrefslogtreecommitdiff
path: root/magefile.go
blob: ac5fa87962597c2af04c92bee5333324c054aaef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//go:build mage
// +build mage

package main

import (
	"fmt"
	"os"

	"github.com/magefile/mage/mg"
	"github.com/magefile/mage/sh"
)

// Default target to run when none is specified
// 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", "./...")
}

// Run the stanuki CLI
func Run() error {
	return sh.RunV("go", "run", "./cmd/stanuki")
}