Sirshark10

Untitled

Mar 25th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local function run( _sCommand, ... )
  2. local sPath = shell.resolveProgram( _sCommand )
  3. if sPath ~= nil then
  4. tProgramStack[#tProgramStack + 1] = sPath
  5. if multishell then
  6. multishell.setTitle( multishell.getCurrent(), fs.getName( sPath ) )
  7. end
  8. local result = os.run( tEnv, sPath, ... )
  9. tProgramStack[#tProgramStack] = nil
  10. if multishell then
  11. if #tProgramStack > 0 then
  12. multishell.setTitle( multishell.getCurrent(), fs.getName( tProgramStack[#tProgramStack] ) )
  13. else
  14. multishell.setTitle( multishell.getCurrent(), "shell" )
  15. end
  16. end
  17. return result
  18. else
  19. printError( "No such program" )
  20. return false
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment