Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- --Controllo se sono stati inseriti tutti i parametri
- if args[1] == nil then
- print("Uso: cd <directory>")
- return
- end
- --Controllo se la cartella esiste
- if not fs.isDir(args[1]) and not args[1] == ".." then
- print("Cartella non trovata")
- return
- end
- --Controllo che tipo di cartella e'
- --if args[1] == ".." and not shell.dir() == "/" then
- -- dirs = {}
- -- for i in string.gmatch(shell.dir(), "/") do
- -- dirs[#dirs+1] = i
- -- end
- -- dir = ""
- -- for i=1, #dirs-1 do
- -- dir = dir..dirs[i].."/"
- -- end
- -- cDir = dir
- -- shell.setDir(cDir)
- -- return
- --end
- --Cambio la cartella
- if fs.exists(shell.resolve(args[1])) then
- shell.setDir(shell.resolve(args[1]))
- end
Add Comment
Please, Sign In to add comment