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