Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Installation program for moving things to and from a disk.
- --Made by xXPteranoXx
- --Run from command line
- arg = {...}
- baseDir = ""
- function setBaseDir(dir)
- baseDir = dir
- end
- function getBaseDir()
- return baseDir
- end
- function copyFiles(fromDir)
- local fileTable = fs.list(tostring(fromDir))
- local toDir = "installedPrograms/"
- if not fs.isDir(toDir) then
- print("Created the directory "..toDir)
- fs.makeDir(toDir)
- end
- local fCount = 0
- for i,v in pairs(fileTable) do
- print("Moving "..v.." to "..toDir)
- fs.copy(tostring(fromDir.."/"..v), toDir..v)
- fCount = fCount + 1
- print(table.getn(fileTable) - fCount.." files remaining")
- end
- end
- function main()
- --fromDisk is going to be a pretty standard thing.
- --The program by default will copy over from the disk
- --What is there.
- --Network installs will possibly come later.
- --read in our args list
- if table.getn(arg) == 0 then
- print("Please enter a directory to install from!\n")
- return
- end
- copyFiles(tostring(arg[1]))
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment