|
|
|
@ -88,10 +88,12 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function exportFile(srcpath, dstpath)
|
|
|
|
|
if not dstpath then
|
|
|
|
|
dstpath = outdir .. srcpath
|
|
|
|
|
dstpath = outdir .. (dstpath or srcpath)
|
|
|
|
|
if dstpath:sub(-1) == '/' then
|
|
|
|
|
dstpath = dstpath .. srcpath
|
|
|
|
|
end
|
|
|
|
|
local srcf = assert(io.open(srcpath))
|
|
|
|
|
srcpath = 'src/' .. srcpath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--load the file to validate syntax, as a very minimal linter
|
|
|
|
|
do
|
|
|
|
@ -103,6 +105,7 @@ local function exportFile(srcpath, dstpath)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local srcf = assert(io.open(srcpath))
|
|
|
|
|
local dstf = assert(io.open(dstpath, 'w'))
|
|
|
|
|
|
|
|
|
|
--for now, run a very minimal minifier
|
|
|
|
@ -159,15 +162,15 @@ fs.makeDirectory(outdir)
|
|
|
|
|
exportFile('boot.lua')
|
|
|
|
|
|
|
|
|
|
fs.makeDirectory(outdir .. 'core/')
|
|
|
|
|
exportFile('src/init.lua', outdir .. 'core/init.lua')
|
|
|
|
|
exportFile('init.lua', 'core/')
|
|
|
|
|
fs.makeDirectory(outdir .. 'core/bin')
|
|
|
|
|
exportFile('src/bin/tty.lua', outdir .. 'core/bin/tty.lua')
|
|
|
|
|
exportFile('bin/tty.lua', 'core/')
|
|
|
|
|
|
|
|
|
|
fs.makeDirectory(outdir .. 'livedisk/')
|
|
|
|
|
assert(fs.copy(outdir .. 'core/init.lua', outdir .. 'livedisk/init.lua'))
|
|
|
|
|
fs.makeDirectory(outdir .. 'livedisk/bin/')
|
|
|
|
|
assert(fs.copy(outdir .. 'core/bin/tty.lua', outdir .. 'livedisk/bin/tty.lua'))
|
|
|
|
|
fs.makeDirectory(outdir .. 'livedisk/etc/')
|
|
|
|
|
exportFile('src/livedisk/init.lua', outdir .. 'livedisk/etc/init.lua')
|
|
|
|
|
exportFile('livedisk/init.lua', 'livedisk/etc/init.lua')
|
|
|
|
|
|
|
|
|
|
-- vi: set ts=2:
|
|
|
|
|