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.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()
|
routes := loadDirs()
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ var gitCommit string = "devel"
|
|||||||
|
|
||||||
const PROGRAM_NAME string = "fes"
|
const PROGRAM_NAME string = "fes"
|
||||||
const PROGRAM_NAME_LONG string = "fes/fSD"
|
const PROGRAM_NAME_LONG string = "fes/fSD"
|
||||||
const VERSION string = "1.1.0"
|
const VERSION string = "1.1.1"
|
||||||
|
|
||||||
func Version() {
|
func Version() {
|
||||||
fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)
|
fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)
|
||||||
|
|||||||
Reference in New Issue
Block a user