diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-08-22 14:32:38 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-08-22 14:32:38 -0400 |
| commit | 25af93b5d1281e7a0f8d8869c5bff0a2ce8cf1bf (patch) | |
| tree | a7b5609cc5c6170b3ecde511ce6a245a1c899113 /src/compile.lua | |
| parent | 5871a659d3436cfd7ed813bd317036d9b45e2e90 (diff) | |
| download | glum-25af93b5d1281e7a0f8d8869c5bff0a2ce8cf1bf.tar.gz glum-25af93b5d1281e7a0f8d8869c5bff0a2ce8cf1bf.tar.bz2 glum-25af93b5d1281e7a0f8d8869c5bff0a2ce8cf1bf.zip | |
Completed minifier, created+completed uglifier
Diffstat (limited to 'src/compile.lua')
| -rw-r--r-- | src/compile.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/compile.lua b/src/compile.lua new file mode 100644 index 0000000..13f652e --- /dev/null +++ b/src/compile.lua @@ -0,0 +1,31 @@ +--[[ + Interprets a .pill file to minify a file structure +]] + +local lfs = require("lfs") + +--Create some common functions +local function getfile(filename) + if file ~= nil then --glua environment + return file.Read(filename) + elseif io.open ~= nil then --Lua environment + return io.open(filename,"r"):read("*a") + else + error("Could not find a way to read from files!") + end +end + +local function putfile(filename,data) + if file ~= nil then --gLua environment + file.Write(filename,data) + elseif io.open ~= nil then --Lua environment + io.open(filename):write(data) + end +end + +local function getdirs(filepath) + local files, directories = file.Find( filepath .. "/*", "LUA" ) +end + +local filepath = arg[1] +local pillfile = io.open(filepath) |
