multiconf with -confdir arg

This commit is contained in:
vcptr
2019-12-31 11:45:19 +08:00
parent 3c96c6ac22
commit 5ae47d45c2
6 changed files with 56 additions and 8 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"io"
"os"
"os/exec"
"strings"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/platform"
@@ -42,7 +43,7 @@ func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
// log stderr, info message
if !errBuffer.IsEmpty() {
newError("v2ctl > \n", errBuffer.MultiBuffer.String()).AtInfo().WriteToLog()
newError("<v2ctl message> \n", strings.TrimSpace(errBuffer.MultiBuffer.String())).AtInfo().WriteToLog()
}
return outBuffer.MultiBuffer, nil
+6
View File
@@ -83,3 +83,9 @@ func GetConfigurationPath() string {
configPath := NewEnvFlag(name).GetValue(getExecutableDir)
return filepath.Join(configPath, "config.json")
}
func GetConfDirPath() string {
const name = "v2ray.location.confdir"
configPath := NewEnvFlag(name).GetValue(getExecutableDir)
return configPath
}