Created
November 6, 2012 19:49
-
-
Save anonymous/4027039 to your computer and use it in GitHub Desktop.
Minimal Lua Livecoding Environment
This file contains hidden or 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
local lfs = require("lfs") | |
local old = 0 | |
local file_path = "livecoding.lua" | |
local t = 0 | |
while true do | |
t = t + 1 | |
if old < lfs.attributes( file_path ).modification then | |
old = lfs.attributes( file_path ).modification | |
pcall(dofile, file_path) | |
end | |
-- run is the callback function in the livecoding file | |
pcall(run, t) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment