Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit a972ab9

Browse files
authored
unicorntool: evaluate packages in sandbox
1 parent 6241279 commit a972ab9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

unicorntool/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ end
1515

1616
complete()
1717
if command == "install" or command == "add" then
18-
local f = dofile(target)
19-
unicorn.core.install(f)
18+
local f = fs.open(target, "r")
19+
local contents = f.readAll()
20+
f.close()
21+
local p = unicorn.util.evaluateInSandbox(contents)
22+
unicorn.core.install(p)
2023
elseif command == "uninstall" or command == "remove" then
2124
unicorn.core.uninstall(target)
2225
else

0 commit comments

Comments
 (0)