mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
cleanup
This commit is contained in:
6 files changed
+15
-17
No files matched your search
+6
-12
@@ -76,39 +76,33 @@ func build(targetOS, targetArch string, archive bool, version string, metadataFi
|
||||
|
||||
targetFile := getTargetFile(v2rayOS)
|
||||
targetFileFull := filepath.Join(targetDir, targetFile)
|
||||
err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch, "")
|
||||
if err != nil {
|
||||
if err := buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch, ""); err != nil {
|
||||
fmt.Println("Unable to build V2Ray: " + err.Error())
|
||||
}
|
||||
if v2rayOS == Windows {
|
||||
err = buildV2Ray(filepath.Join(targetDir, "w"+targetFile), version, v2rayOS, v2rayArch, "-H windowsgui")
|
||||
if err != nil {
|
||||
if err := buildV2Ray(filepath.Join(targetDir, "w"+targetFile), version, v2rayOS, v2rayArch, "-H windowsgui"); err != nil {
|
||||
fmt.Println("Unable to build V2Ray no console: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if *flagSignBinary {
|
||||
err := signFile(targetFileFull)
|
||||
if err != nil {
|
||||
if err := signFile(targetFileFull); err != nil {
|
||||
fmt.Println("Unable to sign V2Ray binary: " + err.Error())
|
||||
}
|
||||
|
||||
if v2rayOS == Windows {
|
||||
err = signFile(filepath.Join(targetDir, "w"+targetFile))
|
||||
if err != nil {
|
||||
if err := signFile(filepath.Join(targetDir, "w"+targetFile)); err != nil {
|
||||
fmt.Println("Unable to sign V2Ray no console: " + err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err = copyConfigFiles(targetDir, v2rayOS)
|
||||
if err != nil {
|
||||
if err := copyConfigFiles(targetDir, v2rayOS); err != nil {
|
||||
fmt.Println("Unable to copy config files: " + err.Error())
|
||||
}
|
||||
|
||||
if archive {
|
||||
err := os.Chdir(binPath)
|
||||
if err != nil {
|
||||
if err := os.Chdir(binPath); err != nil {
|
||||
fmt.Printf("Unable to switch to directory (%s): %v\n", binPath, err)
|
||||
}
|
||||
suffix := getSuffix(v2rayOS, v2rayArch)
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch, ext
|
||||
if version != "custom" {
|
||||
year, month, day := time.Now().UTC().Date()
|
||||
today := fmt.Sprintf("%04d%02d%02d", year, int(month), day)
|
||||
ldFlags = ldFlags + " -X v2ray.com/core.version=" + version + " -X v2ray.com/core.build=" + today
|
||||
bUser := os.Getenv("V_USER")
|
||||
ldFlags = ldFlags + " -X v2ray.com/core.version=" + version + " -X v2ray.com/core.build=" + today + " -X v2ray.core/core/tools/conf.bUser=" + bUser
|
||||
}
|
||||
cmd := exec.Command(
|
||||
"go", "build",
|
||||
|
||||
Reference in new issue
Block a user