3c087aaddf
stopped component.invoke from throwing a cryptic error, and ported over cat, cd, clear, cp, edit, ls, lsdrv, and mkdir
16 lines
383 B
Lua
16 lines
383 B
Lua
local directory = ...
|
|
local fs = require("filesystem")
|
|
local shell = require("shell")
|
|
|
|
if not directory then
|
|
return
|
|
end
|
|
if directory:sub(1, 1) ~= "/" then
|
|
directory = fs.concat(shell.getWorkingDirectory(), directory)
|
|
end
|
|
if fs.exists(directory) and fs.isDirectory(directory) then
|
|
shell.setWorkingDirectory(fs.canonical(directory))
|
|
else
|
|
print("\27[91mNo such directory.")
|
|
end
|