fix root for the '.' case

This commit is contained in:
2026-01-26 18:19:05 -05:00
parent 0994a28e77
commit 73b2ad0f11
2 changed files with 12 additions and 2 deletions

View File

@@ -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()

View File

@@ -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)