2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-31 18:53:22 +00:00

fix: trim extra whitespace from cd args

this fixed an issue with `cd -` not working
This commit is contained in:
sammyette 2021-10-08 09:49:57 -04:00
parent 400dd2944d
commit cff7827ace
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5

View File

@ -16,7 +16,7 @@ commander.register('cd', function (args)
path = path .. tostring(args[i]) .. ' '
end
path = path:gsub('$%$','\0'):gsub('${([%w_]+)}', os.getenv)
:gsub('$([%w_]+)', os.getenv):gsub('%z','$')
:gsub('$([%w_]+)', os.getenv):gsub('%z','$'):gsub('^%s*(.-)%s*$', '%1')
if path == '-' then
path = oldDir