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

27 lines
439 B
Go
Raw Normal View History

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