-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.go
More file actions
32 lines (27 loc) · 811 Bytes
/
Copy pathtasks.go
File metadata and controls
32 lines (27 loc) · 811 Bytes
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
//go:build ignore
package main
import (
"os"
"os/exec"
"slices"
)
func main() {
var cmd string
switch {
case slices.Contains(os.Args, "-b"):
cmd = "windres assets/res.rc -O coff -o cmd/wike/res.syso && " +
"cp cmd/wike/res.syso cmd/wike-daemon/res.syso && " +
"go build -o Wike.exe ./cmd/wike && " +
"go build -ldflags='-H=windowsgui' -o WikeDaemon.exe ./cmd/wike-daemon"
case slices.Contains(os.Args, "-r"):
cmd = "go run ./cmd/wike"
case slices.Contains(os.Args, "-f"):
cmd = "go fmt ./..."
case slices.Contains(os.Args, "-l"):
cmd = "bunx relion -b assets/res.rc cmd/wike/main.go"
}
execCmd := exec.Command("bash", "-c", cmd)
execCmd.Stdout, execCmd.Stderr, execCmd.Stdin = os.Stdout, os.Stderr, os.Stdin
execCmd.Env = append(os.Environ(), "GOOS=windows")
execCmd.Run()
}