moved cd() into a new library, shutil.
This commit is contained in:
parent
ed2503e9a2
commit
ba8a800940
@ -9,6 +9,7 @@ modules/lib/print.lua
|
||||
modules/drivers/kbd.lua
|
||||
modules/drivers/net.lua
|
||||
modules/lib/readline.lua
|
||||
modules/lib/shutil.lua
|
||||
modules/applications/luash.lua
|
||||
modules/applications/genkernel.lua
|
||||
modules/util/fs-automount.lua
|
||||
|
@ -1,8 +1,5 @@
|
||||
function luash(si)
|
||||
spawn("lua shell",function()
|
||||
function cd(p)
|
||||
os.setenv("PWD",fs.simplify((os.getenv("PWD") or "").."/"..p))
|
||||
end
|
||||
coroutine.yield()
|
||||
print(_OSVERSION..", "..string.format("%4d",computer.totalMemory()/1024).."K memory, "..string.format("%4d",computer.freeMemory()/1024).."K free")
|
||||
print(_VERSION)
|
||||
|
12
modules/lib/shutil.lua
Normal file
12
modules/lib/shutil.lua
Normal file
@ -0,0 +1,12 @@
|
||||
function cd(p)
|
||||
os.setenv("PWD",fs.simplify((os.getenv("PWD") or "").."/"..p))
|
||||
end
|
||||
function ls(p)
|
||||
for k,v in ipairs(fs.list(p)) do print(v) end
|
||||
end
|
||||
function rm(p)
|
||||
fs.rm(p)
|
||||
end
|
||||
function mkdir(p)
|
||||
fs.mkdir(p)
|
||||
end
|
Loading…
Reference in New Issue
Block a user