mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-12 22:42:18 +00:00
Smart config file
This commit is contained in:
1 parent
b6a0d0aba9
commit
9803bfc3a9
2 files changed
+20
-6
No files matched your search
+5
-2
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch) error {
|
||||
ldFlags := "-s"
|
||||
if version != "" {
|
||||
if version != "custom" {
|
||||
year, month, day := time.Now().UTC().Date()
|
||||
today := fmt.Sprintf("%04d%02d%02d", year, int(month), day)
|
||||
ldFlags = ldFlags + " -X github.com/v2ray/v2ray-core.version=" + version + " -X github.com/v2ray/v2ray-core.build=" + today
|
||||
@@ -17,6 +17,9 @@ func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch) err
|
||||
cmd := exec.Command("go", "build", "-o", targetFile, "-compiler", "gc", "-ldflags", ldFlags, "github.com/v2ray/v2ray-core/release/server")
|
||||
cmd.Env = append(cmd.Env, "GOOS="+string(goOS), "GOARCH="+string(goArch))
|
||||
cmd.Env = append(cmd.Env, os.Environ()...)
|
||||
_, err := cmd.Output()
|
||||
output, err := cmd.CombinedOutput()
|
||||
if len(output) > 0 {
|
||||
fmt.Println(string(output))
|
||||
}
|
||||
return err
|
||||
}
|
||||
Reference in new issue
Block a user