Change in how love2d deals with folders on OSX?

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.
nunix
Prole
Posts: 28
Joined: Fri Jan 30, 2009 4:38 am

Change in how love2d deals with folders on OSX?

Post 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?
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

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

Post by Lafolie »

Oh great, another reason not to upgrade. BlackBulletIV might know the answer, I think he likes to update to these things :)
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post 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.
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

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

Post 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.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

Well either way, renaming a folder to .love is not a correct method. :P
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post 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.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

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

Post 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.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post 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.
nunix
Prole
Posts: 28
Joined: Fri Jan 30, 2009 4:38 am

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

Post 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)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 48 guests