Page 1 of 2

Change in how love2d deals with folders on OSX?

Posted: Wed Sep 26, 2012 10:38 pm
by nunix
I recently upgraded to Mountain Lion from Snow Leopard (10.6 to 10.8) and have gotten back into love2d/Lua programming. What I remember doing - and what my old project files seem to back up - is that I used to be able to simply add a .love extension to a folder, and it became love-executable (no need to make a zip or anything). That no longer appears to be the case. Did I set something special up and have since forgotten, or has some change been made to the OS or to love that makes that no longer work?

Re: Change in how love2d deals with folders on OSX?

Posted: Wed Sep 26, 2012 10:43 pm
by Lafolie
Oh great, another reason not to upgrade. BlackBulletIV might know the answer, I think he likes to update to these things :)

Re: Change in how love2d deals with folders on OSX?

Posted: Thu Sep 27, 2012 1:48 am
by slime
You always need to zip the contents of the folder and change the extension to .love. You can also drag the folder onto the LÖVE application and it will run it, you might be mixing the two in your head by accident.

Re: Change in how love2d deals with folders on OSX?

Posted: Thu Sep 27, 2012 2:09 am
by Qcode
No slime, nunix's right. I've updated as well, and that no longer works. You should know that back when you didn't properly zip the folder, it wouldn't work on different OS's. So yes, that it is a change to the OS, and not your fault.

Re: Change in how love2d deals with folders on OSX?

Posted: Thu Sep 27, 2012 3:13 am
by slime
Well either way, renaming a folder to .love is not a correct method. :P

Re: Change in how love2d deals with folders on OSX?

Posted: Thu Sep 27, 2012 9:15 am
by Jasoco
slime wrote:You always need to zip the contents of the folder and change the extension to .love. You can also drag the folder onto the LÖVE application and it will run it, you might be mixing the two in your head by accident.
Not on OS X. Adding .love to a folder name turns it into a .love package which is treated exactly the same as a .love zip file. At least it's supposed to be. I've noticed that 0.8.0 will not let me open a Package by double-clicking, but 0.7.x and lower all do so something was broken on Löve's end.

For my own projects I use the Terminal so it doesn't come up as often as you'd think. But if I want to open a project I'm not currently working on and therefore haven't set up in the Terminal, I run into that problem. I can't even drop the package on the love.app. Löve 0.8.0 is set up to not recognize packages for some reason. Unless it really is something Mountain Lion did which seems strange. I'm just glad someone else noticed this same problem.

Re: Change in how love2d deals with folders on OSX?

Posted: Thu Sep 27, 2012 10:08 am
by Lafolie
Jasoco are you packaging the game every time you want to test it? I make it find the relevant main.lua based on the directory of the currently open (or focussed) file and just run that.

Code: Select all

#!/usr/bin/bash
pdir=%%d
if ! [ -f %%d"/main.lua" ]; then
	pdir=%%d"/.."
fi
/Applications/love.app/Contents/MacOS/love $pdir
%%d escapes into the appropriate directory. This might not work if you're editing a file that's more than 1 'level below' the root main.lua dir, but it's possible to change that of course. Oh, and spaces in dir names cause it to fail. I tend to not use spaces in filenames though so it's not a problem for myself.

Re: Change in how love2d deals with folders on OSX?

Posted: Sat Sep 29, 2012 11:08 am
by bartbes
Jasoco wrote:At least it's supposed to be.
Where did you get that from, anyway? That's not at all what love wants/needs, it's just something OSX did.

Re: Change in how love2d deals with folders on OSX?

Posted: Sun Sep 30, 2012 6:47 pm
by Jasoco
Lafolie wrote:Jasoco are you packaging the game every time you want to test it? I make it find the relevant main.lua based on the directory of the currently open (or focussed) file and just run that.
No. I run it from the Terminal. I don't even put the .love extension on my folders until I need to upload it really.

I have no problems when I'm working with my own projects. It's when I want to quickly run someone elses project and need to edit a file and quickly run it.

All Löve versions up to 0.7.2 would let me double-click packages. 0.8.0 doesn't work anymore. Which is strange. As I still have 0.7.2 and 0.6.0 and 0.5.0 as well all for testing purposes. All non-0.8.0 versions let me double-click. I can run a package fine from the Terminal since I'm running the love binary directly.

Re: Change in how love2d deals with folders on OSX?

Posted: Sun Sep 30, 2012 8:29 pm
by nunix
So since apparently it's a .8.0 thing, is there a way to set up something in OSX to restore this functionality? Automator script or folder action or something? (I am not an OSX power user, obviously)