fix: use hilbish.cwd to get cwd

pull/59/head
sammyette 2021-05-27 19:06:45 -04:00
parent af4b4b2ae0
commit 5408e68e19
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 4 additions and 2 deletions

View File

@ -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