aboutsummaryrefslogtreecommitdiff
path: root/src/compile.lua
blob: 13f652ecfe260679e8b1396e565df14f667a0827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)