mirror of
https://github.com/Kiritow/OpenComputerScripts.git
synced 2024-03-22 13:10:46 +08:00
Add command line tool for bundling files.
This commit is contained in:
parent
50d3d4fd1b
commit
a62bad4ad2
23
bundle.lua
Normal file
23
bundle.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
-- bundle: command line tool for bundling files
|
||||||
|
|
||||||
|
local component=require("component")
|
||||||
|
local shell=require("shell")
|
||||||
|
require("libbundle")
|
||||||
|
|
||||||
|
local args,opts=shell.parse(...)
|
||||||
|
local argc=#args
|
||||||
|
|
||||||
|
if(argc<1 or (opts.d==nil and argc<2)) then
|
||||||
|
print("Usage: bundle [-d] <bundled file> [<input file>, ...]")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if(opts.d~=nil) then
|
||||||
|
Unbundle(args[1])
|
||||||
|
else
|
||||||
|
local t={}
|
||||||
|
for i=2,argc,1 do
|
||||||
|
table.insert(t,args[i])
|
||||||
|
end
|
||||||
|
Bundle(t,args[1])
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user