mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-02 19:53:23 +00:00
fix: use hilbish.cwd to get cwd
This commit is contained in:
parent
af4b4b2ae0
commit
5408e68e19
@ -3,7 +3,7 @@
|
||||
local fs = require 'fs'
|
||||
local commander = require 'commander'
|
||||
local bait = require 'bait'
|
||||
local old_dir = os.getenv "PWD"
|
||||
local old_dir = hilbish.cwd()
|
||||
|
||||
-- Builtins
|
||||
commander.register('cd', function (args)
|
||||
@ -18,8 +18,10 @@ commander.register('cd', function (args)
|
||||
|
||||
if path == '-' then
|
||||
path = old_dir
|
||||
print(path)
|
||||
end
|
||||
old_dir = os.getenv "PWD"
|
||||
old_dir = hilbish.cwd()
|
||||
|
||||
local ok, err = pcall(function() fs.cd(path) end)
|
||||
if not ok then
|
||||
if err == 1 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user