mirror of https://github.com/Hilbis/Hilbish
fix: throw cd hook only after changing directory
parent
30ffe9cab0
commit
eab3f27ebf
|
@ -10,7 +10,6 @@ if shlvl ~= nil then os.setenv('SHLVL', shlvl + 1) else os.setenv('SHLVL', 1) en
|
||||||
|
|
||||||
-- Builtins
|
-- Builtins
|
||||||
commander.register('cd', function (args)
|
commander.register('cd', function (args)
|
||||||
bait.throw('cd', args)
|
|
||||||
if #args > 0 then
|
if #args > 0 then
|
||||||
local path = ''
|
local path = ''
|
||||||
for i = 1, #args do
|
for i = 1, #args do
|
||||||
|
@ -32,9 +31,11 @@ commander.register('cd', function (args)
|
||||||
end
|
end
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
|
bait.throw('cd', path)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
fs.cd(os.getenv 'HOME')
|
fs.cd(os.getenv 'HOME')
|
||||||
|
bait.throw('cd', os.getenv 'HOME')
|
||||||
|
|
||||||
return
|
return
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue