Fix: parse external-ui

This commit is contained in:
gVisor bot 2018-12-21 10:55:21 +08:00
parent 95dd43a5ed
commit a3fee826f1

View file

@ -153,6 +153,7 @@ func parseGeneral(cfg *rawConfig) (*General, error) {
mode := cfg.Mode mode := cfg.Mode
logLevel := cfg.LogLevel logLevel := cfg.LogLevel
if externalUI != "" {
if !filepath.IsAbs(externalUI) { if !filepath.IsAbs(externalUI) {
externalUI = filepath.Join(C.Path.HomeDir(), externalUI) externalUI = filepath.Join(C.Path.HomeDir(), externalUI)
} }
@ -160,6 +161,7 @@ func parseGeneral(cfg *rawConfig) (*General, error) {
if _, err := os.Stat(externalUI); os.IsNotExist(err) { if _, err := os.Stat(externalUI); os.IsNotExist(err) {
return nil, fmt.Errorf("external-ui: %s not exist", externalUI) return nil, fmt.Errorf("external-ui: %s not exist", externalUI)
} }
}
general := &General{ general := &General{
Port: port, Port: port,