Page 1 of 1

Handy launch.command

Posted: Sun Sep 01, 2013 11:47 am
by sansa
I've begun to set myself up learning love, in order to begin prototyping a series of possible ideas

When i work on any coding projects I tend to always get quite messy, with multiple copies of prototypes, so for my purpose i wanted a little generic launcher that would allow me to copy paste a whole love project, rename it, and it would automatically work whatever path it is in.

I'm sure people have already done this in the past, but I just thought i'd share it, since it might be handy to have in the wiki or something. Its just a very small tip i wanted to share, sorry if its too basic to warrant a forum thread etc.

For my mac os x, i stuck this in a file called launch.command

#!/bin/bash
SCRIPTPATH=`dirname "$0"`
exec /Applications/love.app/Contents/MacOS/love $SCRIPTPATH


then i made it executable by doing this in terminal
cd thepathtothedirectory
chmod +x launch.command

Re: Handy launch.command

Posted: Mon Sep 02, 2013 6:10 pm
by Lafolie
Or you could just add an alias to your bashrc / bash_profile.

Re: Handy launch.command

Posted: Tue Sep 03, 2013 6:29 pm
by Jasoco
I already do this:

Code: Select all

#!/bin/bash
~/Documents/Projects/LÖVE/Apps/love.app/Contents/MacOS/love "${0%/*}"
But only because I can't figure out how to edit my bash profile to make it work. This works fine.

Re: Handy launch.command

Posted: Wed Sep 04, 2013 2:46 am
by Nsmurf
Not to start a flamewar, but if you use Vim, just type ":!love ."
It's like magic! :awesome:

Re: Handy launch.command

Posted: Sun Sep 08, 2013 8:02 pm
by Ranguna259
Windows only:
Notepad++ run command

Code: Select all

"c:\your\path\to\love.exe" "$(CURRENT_DIRECTORY)"
That's what I use

Re: Handy launch.command

Posted: Sun Sep 08, 2013 9:23 pm
by raidho36
A simple batch file in game directory.

Code: Select all

"C:\Program Files (x86)\LOVE\love.exe" "%CD%"

Re: Handy launch.command

Posted: Sun Sep 08, 2013 9:32 pm
by Nixola
raidho36 wrote:A simple batch file in game directory.

Code: Select all

"C:\Program Files (x86)\LOVE\love.exe" "%CD%"
A simpler batch file in game directory (I edited PATH though).

Code: Select all

love .