mirror of https://github.com/Hilbis/Hilbish
fix: use hilbish.cwd to get cwd
parent
af4b4b2ae0
commit
5408e68e19
|
@ -3,7 +3,7 @@
|
||||||
local fs = require 'fs'
|
local fs = require 'fs'
|
||||||
local commander = require 'commander'
|
local commander = require 'commander'
|
||||||
local bait = require 'bait'
|
local bait = require 'bait'
|
||||||
local old_dir = os.getenv "PWD"
|
local old_dir = hilbish.cwd()
|
||||||
|
|
||||||
-- Builtins
|
-- Builtins
|
||||||
commander.register('cd', function (args)
|
commander.register('cd', function (args)
|
||||||
|
@ -18,8 +18,10 @@ commander.register('cd', function (args)
|
||||||
|
|
||||||
if path == '-' then
|
if path == '-' then
|
||||||
path = old_dir
|
path = old_dir
|
||||||
|
print(path)
|
||||||
end
|
end
|
||||||
old_dir = os.getenv "PWD"
|
old_dir = hilbish.cwd()
|
||||||
|
|
||||||
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
|
||||||
if err == 1 then
|
if err == 1 then
|
||||||
|
|
Loading…
Reference in New Issue