Advertisement
Stiepen

startup call code, rewrite

Nov 13th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. for sPath in shell.getEnvVar("startup", "", true).readAll():gmatch('([^:]+)') do
  2.   if fs.isDir(sPath) then
  3.     local list = fs.list(sPath)
  4.     for i=1, #list do
  5.       local s, m = shell.run(sPath..list[i])
  6.       if not s then
  7.         printError("Failed to run "..sPath..". error: "..m)
  8.       end
  9.     end
  10.   else
  11.     local s, m = shell.run(sPath)
  12.     if not s then
  13.       printError("Failed to run "..sPath..". error: "..m)
  14.     end
  15.   end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement