fix root for the '.' case
This commit is contained in:
@@ -18,7 +18,17 @@ func Start(dir string) {
|
||||
ui.Error(fmt.Sprintf("failed to change directory to %s", dir), err)
|
||||
}
|
||||
|
||||
ui.Log("running root=%s, port=%d.", filepath.Clean(dir), *config.Port)
|
||||
root := filepath.Clean(dir)
|
||||
|
||||
if root == "." {
|
||||
if res, err := filepath.Abs(root); err == nil {
|
||||
root = filepath.Base(res)
|
||||
} else {
|
||||
ui.Error("failed to get absolute path", err)
|
||||
}
|
||||
}
|
||||
|
||||
ui.Log("running root=%s, port=%d.", root, *config.Port)
|
||||
|
||||
routes := loadDirs()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user