probonopd / go-appimage

Go implementation of AppImage tools
MIT License
813 stars 71 forks source link

Double slash in folder path #214

Open trumpton opened 2 years ago

trumpton commented 2 years ago

ERROR integrate: rename /home/steve/.cache/applications//appimagekit_d4d61be6549e56e0a33a8ef883149b25.desktop /home/steve/.local/share/applications/appimagekit_d4d61be6549e56e0a33a8ef88

There is a double slash in the source of the cache folder - this is linked to the hard-coded /applications/ folder.

appimaged.go:

desktopcachedir := xdg.CacheHome + "/applications**/**" // FIXME: Do not hardcode here and in other places
...
err := os.Rename(desktopcachedir+"**/**appimagekit_"+ai.md5+".desktop", ai.desktopfilepath)
...
log.Println("main: Moved ", desktopcachedir+"**/**appimagekit_"+ai.md5+".desktop to", xdg.DataHome+"/applications/")
CalebQ42 commented 2 years ago

These paths should probably be replaced with filepath.Join to make sure this doesn't happen. I'm guessing this is due to the distro your using adding a trailing slash to CacheHome while the distros that we official test with do not.

probonopd commented 2 years ago

filepath.Join would be the way to go; does anyone want to send a PR?