Tries to make PortableApps folder before failing

This commit is contained in:
Belac Darkstorm
2016-09-23 14:32:30 -05:00
parent 5eeb9cc702
commit d64d88e0a5
2 changed files with 9 additions and 7 deletions
+9 -1
View File
@@ -16,7 +16,15 @@ import (
func setup() {
PortableAppsFold, err := os.Open("PortableApps")
if PAStat, _ := PortableAppsFold.Stat(); err != nil || !PAStat.IsDir() {
panic("PortableApps folder not found!!")
os.Mkdir("PortableApps", 0777)
PortableAppsFold, err = os.Open("PortableApps")
if err != nil {
panic("Can't find PortableApps folder and can't create one!")
}
}
_, err = os.Open("PortableApps/LinuxPACom/common.sh")
if err == nil {
comEnbld = true
}
PAFolds, _ := PortableAppsFold.Readdirnames(-1)
sort.Strings(PAFolds)