mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-21 04:53:24 +00:00
fix: get abs path before doing cd
This commit is contained in:
parent
2a9330c692
commit
64dd52690d
@ -17,11 +17,13 @@ commander.register('cd', function (args, sinks)
|
|||||||
sinks.out:writeln(path)
|
sinks.out:writeln(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local absPath = fs.abs(path)
|
||||||
local ok, err = pcall(function() fs.cd(path) end)
|
local ok, err = pcall(function() fs.cd(path) end)
|
||||||
if not ok then
|
if not ok then
|
||||||
sinks.out:writeln(err)
|
sinks.out:writeln(err)
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
bait.throw('cd', path, oldPath)
|
bait.throw('cd', path, oldPath)
|
||||||
bait.throw('hilbish.cd', fs.abs(path), oldPath)
|
bait.throw('hilbish.cd', absPath, oldPath)
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user