diff options
| -rw-r--r-- | tests/package_shell_test.lua | 7 | ||||
| -rw-r--r-- | yazi-enter.yazi/main.lua | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/package_shell_test.lua b/tests/package_shell_test.lua index da3ab2b..9330c71 100644 --- a/tests/package_shell_test.lua +++ b/tests/package_shell_test.lua @@ -29,6 +29,9 @@ end local sync_calls = 0 local sync_callbacks = {} local environment = { + error = error, + pairs = pairs, + type = type, ya = { sync = function(callback) sync_calls = sync_calls + 1 @@ -45,7 +48,9 @@ local plugin = chunk() assert(sync_calls == 1, "expected one top-level synchronous transaction") assert(type(plugin) == "table", "plugin must export a table") assert(type(plugin.entry) == "function", "plugin must export an entry method") -assert(plugin.entry() == nil, "entry shell must load with the bundled runtime") + +local intent = plugin:entry({ args = { "directory" } }) +assert(intent.mode == "directory", "entry shell must load with the bundled runtime") assert(sync_callbacks[1]() == 0, "commit shell must load with the bundled runtime") print("package shell checks passed") diff --git a/yazi-enter.yazi/main.lua b/yazi-enter.yazi/main.lua index 2edee41..33c0abe 100644 --- a/yazi-enter.yazi/main.lua +++ b/yazi-enter.yazi/main.lua @@ -87,5 +87,7 @@ local commit = ya.sync(function() end) return { - entry = function() end, + entry = function(_, job) + return parse_invocation_intent(job.args) + end, } |