2dee5eaba7
This reverts commit cbf25999f0.
15 lines
344 B
Lua
15 lines
344 B
Lua
local directory = ...
|
|
local fs = import("filesystem")
|
|
|
|
if not directory then
|
|
return
|
|
end
|
|
if directory:sub(1, 1) ~= "/" then
|
|
directory = fs.concat(shell.workingDirectory, directory)
|
|
end
|
|
if fs.exists(directory) and fs.isDirectory(directory) then
|
|
shell.workingDirectory = fs.canonical(directory)
|
|
else
|
|
print("\27[91mNo such directory.")
|
|
end
|