LÖVE 11.1 AppImage and relative paths

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Party member
Posts: 297
Joined: Sat Jul 22, 2017 7:43 pm

LÖVE 11.1 AppImage and relative paths

Post by grump » Mon Apr 16, 2018 2:14 pm

I don't want to upgrade my system to 11.1 yet, so I tried the AppImage distribution. I quickly learned that this doesn't work:

Code: Select all

$ love-11.1-linux-x86_64.AppImage game.love

Code: Select all

Error: [string "boot.lua"]:481: Cannot load game at path '/tmp/.mount_AjgSUk/usr/game.love'
Make sure a folder exists at the specified path.
It only works when specifying the absolute path to the love file/game directory. This seems to be a common problem with AppImageKit. See also here.

This doesn't play well with my current build system. I can probably fix this with a shell script, but it would be nice if it worked out of the box and showed the same behavior as when using a vanilla installation. I don't know jack about AppImages, but the above links seem to suggest it can be fixed when building the image.

If there is another quick solution other than writing a script to expand the path, I'd love to know.

Edit: here's the solution I came up with (requires bash):

Code: Select all

GAME="$(readlink -f ${@: -1})"
set -- "${@:1:$(($#-1))}"
love-11.1-linux-x86_64.AppImage $@ $GAME
I saved this as /usr/bin/love11, with the AppImage in the executable path. Makes both absolute and relative paths work.

User avatar
Sex machine
Posts: 4894
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands

Re: LÖVE 11.1 AppImage and relative paths

Post by bartbes » Mon Apr 16, 2018 6:39 pm

Thanks for the links, it looks like AppImageKit sets the OWD environment variable to the working directory it was called in, I'll probably update the script to switch back to that directory.
Cowardly acts and the eating of birds must not be the deeds of a Hero of Storms.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests