diff --git a/sudo-demo.yazi/README.md b/sudo-demo.yazi/README.md index 154c756..ee9b9d8 100644 --- a/sudo-demo.yazi/README.md +++ b/sudo-demo.yazi/README.md @@ -14,8 +14,8 @@ Add this to your `~/.config/yazi/keymap.toml`: ```toml [[manager.prepend_keymap]] -on = "" -run = "plugin sudo-demo" +on = "" +run = "plugin sudo-demo" ``` Press Ctrl + t to run the plugin, you should [see a message in the log](https://yazi-rs.github.io/docs/plugins/overview#logging). diff --git a/sudo-demo.yazi/init.lua b/sudo-demo.yazi/init.lua index 83c6777..cac94af 100644 --- a/sudo-demo.yazi/init.lua +++ b/sudo-demo.yazi/init.lua @@ -14,7 +14,7 @@ end --- nil: no error --- 1: sudo failed local function run_with_sudo(program, args) - local cmd = Command("sudo"):args({ program, table.unpack(args) }):stdout(Command.PIPED):stderr(Command.PIPED) + local cmd = Command("sudo"):args { program, table.unpack(args) } if sudo_already() then return cmd:output() end @@ -38,7 +38,6 @@ return { end ya.err("stdout", output.stdout) - ya.err("stderr", output.stderr) ya.err("status.code", output.status.code) end, }