mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-12 22:42:18 +00:00
chinaip
This commit is contained in:
1 parent
0ccce0ff7e
commit
c19341ffab
9 files changed
+12894
-6343
No files matched your search
+18
-18
@@ -13,12 +13,12 @@ func copyConfigFile(src, dest string, goOS GoOS, format bool) error {
|
||||
return err
|
||||
}
|
||||
if format {
|
||||
str := string(content)
|
||||
str = strings.Replace(str, "\r\n", "\n", -1)
|
||||
if goOS == Windows {
|
||||
str = strings.Replace(str, "\n", "\r\n", -1)
|
||||
}
|
||||
content = []byte(str)
|
||||
str := string(content)
|
||||
str = strings.Replace(str, "\r\n", "\n", -1)
|
||||
if goOS == Windows {
|
||||
str = strings.Replace(str, "\n", "\r\n", -1)
|
||||
}
|
||||
content = []byte(str)
|
||||
}
|
||||
return ioutil.WriteFile(dest, content, 0777)
|
||||
}
|
||||
@@ -43,19 +43,19 @@ func copyConfigFiles(dir string, goOS GoOS) error {
|
||||
dest = filepath.Join(dir, "vpoint_vmess_freedom.json")
|
||||
|
||||
if err := copyConfigFile(src, dest, goOS, true); err != nil {
|
||||
return err
|
||||
return err
|
||||
}
|
||||
|
||||
if goOS == Linux {
|
||||
if err := os.MkdirAll(filepath.Join(dir, "systemv"), os.ModeDir|0777); err != nil {
|
||||
return err
|
||||
}
|
||||
src = filepath.Join(srcDir, "systemv", "v2ray")
|
||||
dest = filepath.Join(dir, "systemv", "v2ray")
|
||||
if err := copyConfigFile(src, dest, goOS, false); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if goOS == Linux {
|
||||
if err := os.MkdirAll(filepath.Join(dir, "systemv"), os.ModeDir|0777); err != nil {
|
||||
return err
|
||||
}
|
||||
src = filepath.Join(srcDir, "systemv", "v2ray")
|
||||
dest = filepath.Join(dir, "systemv", "v2ray")
|
||||
if err := copyConfigFile(src, dest, goOS, false); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user