Handy launch.command

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
sansa
Prole
Posts: 1
Joined: Sun Sep 01, 2013 11:27 am

Handy launch.command

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

Re: Handy launch.command

Post by Lafolie »

Or you could just add an alias to your bashrc / bash_profile.
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
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Handy launch.command

Post 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.
User avatar
Nsmurf
Party member
Posts: 191
Joined: Fri Jul 27, 2012 1:58 am
Location: West coast.

Re: Handy launch.command

Post by Nsmurf »

Not to start a flamewar, but if you use Vim, just type ":!love ."
It's like magic! :awesome:
OBEY!!!
My Blog
UE0gbWUgd2l0aCB0aGUgd29yZCAnSE1TRycgYXMgdGhlIHN1YmplY3Q=
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Handy launch.command

Post by Ranguna259 »

Windows only:
Notepad++ run command

Code: Select all

"c:\your\path\to\love.exe" "$(CURRENT_DIRECTORY)"
That's what I use
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Handy launch.command

Post by raidho36 »

A simple batch file in game directory.

Code: Select all

"C:\Program Files (x86)\LOVE\love.exe" "%CD%"
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Handy launch.command

Post 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 .
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests