Use * instead of + to match zero or more spaces

This commit is contained in:
sxyazi 2024-12-30 22:29:38 +08:00
parent ab029a76bc
commit 1a9b29aa31
No known key found for this signature in database

View file

@ -108,7 +108,7 @@ local function entry()
if not output then if not output then
return fail("Cannot read `zoxide` output, error: " .. err2) return fail("Cannot read `zoxide` output, error: " .. err2)
elseif not output.status.success and output.status.code ~= 130 then elseif not output.status.success and output.status.code ~= 130 then
return fail("`zoxide` exited with code %s: %s", output.status.code, output.stderr:gsub("^zoxide:%s+", "")) return fail("`zoxide` exited with code %s: %s", output.status.code, output.stderr:gsub("^zoxide:%s*", ""))
end end
local target = output.stdout:gsub("\n$", "") local target = output.stdout:gsub("\n$", "")