diff options
| -rw-r--r-- | xmake/actions/package/main.lua | 9 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/xmake/actions/package/main.lua b/xmake/actions/package/main.lua index 5c392f3b4..caf77d465 100644 --- a/xmake/actions/package/main.lua +++ b/xmake/actions/package/main.lua @@ -20,8 +20,15 @@ -- imports import("core.base.option") +import("core.base.hashset") -- main entry function main() - import(option.get("format") or "local")() + local format = option.get("format") or "local" + local maps = hashset.from({"local", "remote", "localpkg"}) + if maps:has(format) then + import(format)() + else + raise("invalid package format: %s", format or "missing") + end end diff --git a/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua b/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua index dd8ee1eef..58c91afa4 100644 --- a/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua +++ b/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua @@ -24,6 +24,7 @@ local string = require("base/string") local raise = require("sandbox/modules/raise") if not xmake._LUAJIT then + print(debug.traceback()) return end |
