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:
parent
400dd2944d
commit
cff7827ace
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user