sing-box/cmd/internal/build/main.go

27 lines
439 B
Go
Raw Normal View History

2022-12-11 14:38:01 +08:00
package main
import (
2023-06-14 09:37:06 +08:00
"go/build"
2022-12-11 14:38:01 +08:00
"os"
"os/exec"
2022-10-25 12:55:00 +08:00
"github.com/sagernet/sing-box/cmd/internal/build_shared"
2022-12-11 14:38:01 +08:00
"github.com/sagernet/sing-box/log"
)
func main() {
2022-10-25 12:55:00 +08:00
build_shared.FindSDK()
2022-12-11 14:38:01 +08:00
2023-11-15 13:05:33 +08:00
if os.Getenv("GOPATH") == "" {
2023-06-14 09:37:06 +08:00
os.Setenv("GOPATH", build.Default.GOPATH)
}
2022-12-11 14:38:01 +08:00
command := exec.Command(os.Args[1], os.Args[2:]...)
command.Stdout = os.Stdout
command.Stderr = os.Stderr
2023-03-09 16:53:25 +08:00
err := command.Run()
2022-12-11 14:38:01 +08:00
if err != nil {
log.Fatal(err)
}
}