Add command-line interface

This commit is contained in:
Antonin Décimo
2016-01-21 13:09:28 +01:00
parent 873934e526
commit d639fcbf6d
7 changed files with 229 additions and 25 deletions

View File

@@ -60,13 +60,22 @@ function Script:createLoveFile()
if attributes.mode == "directory" then
ar:add_dir(file)
else
ar:add(file, "file", file)
if self.project.compile then
ar:add(file, "string", utils.lua.bytecode(file))
else
ar:add(file, "file", file)
end
end
-- file in the filesystem is more recent than in the archive
elseif attributes and stat and attributes.modification > stat.mtime + 5 then
if attributes.mode == "file" then
utils.io.out("Update "..file.."\n")
ar:replace(assert(ar:name_locate(file)), "file", file)
if self.project.compile then
ar:replace(assert(ar:name_locate(file)), "string",
utils.lua.bytecode(file))
else
ar:replace(assert(ar:name_locate(file)), "file", file)
end
end
end
end