mirror of https://github.com/Hilbis/Hilbish
fix: display error to user if dir does not exist
parent
0d5c826f54
commit
7326cb77c6
|
@ -3,9 +3,15 @@
|
||||||
|
|
||||||
local fs = require 'fs'
|
local fs = require 'fs'
|
||||||
local commander = require 'commander'
|
local commander = require 'commander'
|
||||||
|
local bait = require 'bait'
|
||||||
|
|
||||||
commander.register('cd', function (path)
|
commander.register('cd', function (path)
|
||||||
if #path == 1 then
|
if #path == 1 then
|
||||||
fs.cd(path[1])
|
local ok, err = pcall(function() fs.cd(path[1]) end)
|
||||||
|
if not ok then
|
||||||
|
if err == 1 then
|
||||||
|
print("directory does not exist")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue