From 5408e68e1910639db4fc080dee9d1db392764ffd Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Thu, 27 May 2021 19:06:45 -0400 Subject: [PATCH] fix: use hilbish.cwd to get cwd --- preload.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/preload.lua b/preload.lua index 4cb3d46..ccb8b6d 100644 --- a/preload.lua +++ b/preload.lua @@ -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