Created
December 6, 2011 04:19
-
-
Save clooth/1436712 to your computer and use it in GitHub Desktop.
moonscript compilation helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap('INT') { exit } # graceful exit | |
ROOT = Dir.pwd | |
SRC = File.join(ROOT, 'src') | |
Dir.mkdir(SRC) unless File.directory?(SRC) | |
Dir.chdir(SRC) | |
loop do | |
Dir['**/*.moon'].each do |file| | |
moon_file = File.join(SRC, file) | |
lua_file = File.join(ROOT, file.gsub(/\.moon$/, '.lua')) | |
if not File.file?(lua_file) or File.mtime(moon_file) > File.mtime(lua_file) | |
puts `C:/Lua514/lua.exe C:/Lua514/moonc.lua -t .. #{file}` | |
end | |
end | |
sleep 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment