Skip to content

Commit 0ed566e

Browse files
committed
Allow interactive Lua interpters to load unzip so that users can swap disk to the one containing the zip file on single drive systems.
1 parent dc83aa6 commit 0ed566e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

arch/UNZIP.LUA

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,14 @@ function unzip(p)
126126
f:close()
127127
end
128128

129-
if #arg < 1 then
130-
print((arg[-1] or "?") .. " " .. (arg[0] or "?") .. " file[.zip]")
131-
os.exit(1)
129+
if arg[-1] then
130+
if #arg < 1 then
131+
print((arg[-1] or "?") .. " " .. (arg[0] or "?") .. " file[.zip]")
132+
os.exit(1)
133+
end
134+
unzip(arg[1])
135+
else
136+
-- The script was loaded by an interactive intepreter (most likely to swap disks).
137+
if not pcall(require, "INFLATE") then print("No inflate support") end
138+
print("Insert disk with zipfile and type unzip('zipfile') to begin...")
132139
end
133-
unzip(arg[1])

0 commit comments

Comments
 (0)