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