Skip to content

Commit

Permalink
Possibly full AppImage support
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebQ42 committed Nov 6, 2020
1 parent a0f22e4 commit d2e91ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
13 changes: 1 addition & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@ module github.com/CalebQ42/LinuxPA
go 1.15

require (
github.com/CalebQ42/GoAppImage v0.1.0
github.com/adrg/xdg v0.2.2 // indirect
github.com/alokmenghrajani/gpgeez v0.0.0-20161206084504-1a06f1c582f9 // indirect
github.com/eclipse/paho.mqtt.golang v1.2.0 // indirect
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/CalebQ42/GoAppImage v0.1.1
github.com/gotk3/gotk3 v0.5.0
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/mholt/archiver/v3 v3.5.0
github.com/smartystreets/goconvey v1.6.4 // indirect
go.lsp.dev/uri v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/CalebQ42/GoAppImage v0.1.0 h1:tSDfDqPPfd4WTxueiDFcvTiRCyIgHWus0Pd/wMWm52M=
github.com/CalebQ42/GoAppImage v0.1.0/go.mod h1:2lIvBQsxEpS4pXbkL/VFpJNOwEEFSdzBtLiUIVdUyN0=
github.com/adrg/xdg v0.2.2 h1:A7ZHKRz5KGOLJX/bg7IPzStryhvCzAE1wX+KWawPiAo=
github.com/adrg/xdg v0.2.2/go.mod h1:7I2hH/IT30IsupOpKZ5ue7/qNi3CoKzD6tL3HwpaRMQ=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
Expand Down
22 changes: 20 additions & 2 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,16 @@ func processApp(fold string) (out app) {
ai := goappimage.NewAppImage(out.dir + "/" + out.appimg[0])
fil, err := os.Open(out.dir + "/.appimageconfig/the.md5")
if os.IsNotExist(err) {
ai.ExtractFile(ai.DesktopFilepath, out.dir+"/.appimageconfig/the.desktop", false)
ai.ExtractFile("*.desktop", out.dir+"/.appimageconfig/", false)
appimageconfig, _ := os.Open(out.dir + "/.appimageconfig")
appdirs, _ := appimageconfig.Readdirnames(-1)
for _, dirs := range appdirs {
desktopFil, _ := os.Open(out.dir + "/.appimageconfig/" + dirs)
if stat, _ := desktopFil.Stat(); strings.HasSuffix(dirs, ".desktop") && !stat.IsDir() {
os.Rename(out.dir+"/.appimageconfig/"+dirs, out.dir+"/.appimageconfig/the.desktop")
break
}
}
desk, _ := os.Open(out.dir + "/.appimageconfig/the.desktop")
name, cat, icon := extractDesktopInfo(desk)
if out.name == "" {
Expand All @@ -134,7 +143,16 @@ func processApp(fold string) (out app) {
filMd, _, _ := rdr.ReadLine()
oldMd := string(filMd)
if oldMd != ai.Md5 {
ai.ExtractFile(ai.DesktopFilepath, out.dir+"/.appimageconfig/the.desktop", false)
ai.ExtractFile("*.desktop", out.dir+"/.appimageconfig/", false)
appimageconfig, _ := os.Open(out.dir + "/.appimageconfig")
appdirs, _ := appimageconfig.Readdirnames(-1)
for _, dirs := range appdirs {
desktopFil, _ := os.Open(out.dir + "/.appimageconfig/" + dirs)
if stat, _ := desktopFil.Stat(); strings.HasSuffix(dirs, ".desktop") && !stat.IsDir() {
os.Rename(out.dir+"/.appimageconfig/"+dirs, out.dir+"/.appimageconfig/the.desktop")
break
}
}
os.Remove(out.dir + "/.appimageconfig/the.md5")
fil, _ = os.Create(out.dir + "/.appimageconfig/the.md5")
wrtr := bufio.NewWriter(fil)
Expand Down

0 comments on commit d2e91ba

Please sign in to comment.