Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit bf8bd0c

Browse files
committed
BUGFIX: only list actual directories as servers, no more files ^^
1 parent 9a4551d commit bf8bd0c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

core/screen.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ func GetServers(location string) *[]Screen {
4848
folder := strings.Replace(path, location, "", -1)
4949
if len(strings.Split(folder, "/")) == 2 {
5050
if !strings.HasPrefix(folder, "/.") && !strings.HasPrefix(folder, "/_") {
51-
screens = append(screens, Screen {
52-
Uid: len(screens),
53-
Name: folder[1:] })
51+
pstat, _ := os.Stat(path)
52+
if pstat.Mode().IsDir() {
53+
screens = append(screens, Screen {
54+
Uid: len(screens),
55+
Name: folder[1:] })
56+
}
5457
}
5558
}
5659
return err

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313

1414
const (
15-
VERSION = "2.5.0"
15+
VERSION = "2.5.1"
1616
)
1717

1818
func getRunningSince(timestr string) string {
@@ -33,7 +33,7 @@ func initLoggingPath() {
3333
}
3434

3535
func printScreens(screens *[]core.Screen, servers *[]core.Screen, config *util.Conf) string {
36-
//util.Cls()
36+
util.Cls()
3737
fmt.Println(
3838
"Server Manager v." + VERSION,
3939
"\n(c) Ringo Hoffmann (zekro Development)",

0 commit comments

Comments
 (0)