Tries to make PortableApps folder before failing
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/nelsam/gxui"
|
"github.com/nelsam/gxui"
|
||||||
"github.com/nelsam/gxui/drivers/gl"
|
"github.com/nelsam/gxui/drivers/gl"
|
||||||
"github.com/nelsam/gxui/themes/dark"
|
"github.com/nelsam/gxui/themes/dark"
|
||||||
@@ -20,10 +18,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
_, err := os.Open("PortableApps/LinuxPACom/common.sh")
|
|
||||||
if err == nil {
|
|
||||||
comEnbld = true
|
|
||||||
}
|
|
||||||
master = make(map[string][]app)
|
master = make(map[string][]app)
|
||||||
linmaster = make(map[string][]app)
|
linmaster = make(map[string][]app)
|
||||||
gl.StartDriver(appMain)
|
gl.StartDriver(appMain)
|
||||||
|
|||||||
@@ -16,7 +16,15 @@ import (
|
|||||||
func setup() {
|
func setup() {
|
||||||
PortableAppsFold, err := os.Open("PortableApps")
|
PortableAppsFold, err := os.Open("PortableApps")
|
||||||
if PAStat, _ := PortableAppsFold.Stat(); err != nil || !PAStat.IsDir() {
|
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)
|
PAFolds, _ := PortableAppsFold.Readdirnames(-1)
|
||||||
sort.Strings(PAFolds)
|
sort.Strings(PAFolds)
|
||||||
|
|||||||
Reference in New Issue
Block a user