Re: Distributing your games (making a .love file)
Posted: Wed Feb 02, 2011 9:25 am
For a Linux and Mac friendly version, here's a Ruby script.
Make sure you're in the project directory when executing, and that you provide a filename for the .love file (with or without the extension).
EDIT: On Mac OSX, a cool thing to do is add this to your ~/.bash_profile file:
Then you can execute like this from anywhere:
Make sure you're in the project directory when executing, and that you provide a filename for the .love file (with or without the extension).
Code: Select all
#!/usr/bin/env ruby
if ARGV.length == 0
print "Usage: ./make_love_file.rb love_file_location\n"
print "Make sure you are in the project folder when using this command..\n"
exit 0
end
unless File.exists? 'main.lua'
print "Directory does not contain a main.lua file.\n"
exit 1
end
if ARGV[0]
file = ARGV[0]
file += '.love' unless file.end_with? '.love'
`zip -r #{file} *`
if $?.exitstatus == 0
print "#{ARGV[0]}.love created successfully.\n"
else
print "An error occurred file creating the file.\n"
end
else
print "Please give a name for the .love file.\n"
exit 1
end
Code: Select all
alias lovemake="path/to/where/you/placed/script.rb"
Code: Select all
lovemake LoveFileName