Advertisement
Omsigames

grapes/Paths.lua

Dec 25th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.30 KB | None | 0 0
  1.  
  2. local paths = {system = {}, user = {}}
  3.  
  4. --------------------------------------------------------------------------------
  5.  
  6. paths.system.libraries = "/lib/"
  7. paths.system.applications = "/usr/bin/"
  8. paths.system.icons = "/usr/icons"
  9. paths.system.localizations = "etc/localizations/"
  10. paths.system.extensions = "/usr/extensions/"
  11. paths.system.mounts = "/mnt/"
  12. paths.system.temporary = "/tmp/"
  13. paths.system.pictures = "/usr/pictures/"
  14. paths.system.screensavers = "/usr/screensavers/"
  15. paths.system.users = "/usr/"
  16. --paths.system.versions = "/Versions.cfg"
  17.  
  18. -- paths.system.applicationSample = paths.system.applications .. "Sample.app/"
  19. -- paths.system.applicationAppMarket = paths.system.applications .. "App Market.app/Main.lua"
  20. -- paths.system.applicationMineCodeIDE = paths.system.applications .. "MineCode IDE.app/Main.lua"
  21. -- paths.system.applicationFinder = paths.system.applications .. "Finder.app/Main.lua"
  22. -- paths.system.applicationPictureEdit = paths.system.applications .. "Picture Edit.app/Main.lua"
  23. -- paths.system.applicationSettings = paths.system.applications .. "Settings.app/Main.lua"
  24. -- paths.system.applicationPrint3D = paths.system.applications .. "3D Print.app/Main.lua"
  25. -- paths.system.applicationConsole = paths.system.applications .. "Console.app/Main.lua"
  26. -- paths.system.applicationPictureView = paths.system.applications .. "Picture View.app/Main.lua"
  27.  
  28. --------------------------------------------------------------------------------
  29.  
  30. function paths.create(what)
  31.     for _, path in pairs(what) do
  32.         if path:sub(-1, -1) == "/" then
  33.             require("Filesystem").makeDirectory(path)
  34.         end
  35.     end
  36. end
  37.  
  38. function paths.getUser(name)
  39.     local user = {}
  40.  
  41.     user.home = paths.system.users .. name .. "/"
  42.     user.applicationData = user.home .. "Application data/"
  43.     user.desktop = user.home .. "Desktop/"
  44.     user.libraries = user.home .. "Libraries/"
  45.     user.applications = user.home .. "Applications/"
  46.     user.pictures = user.home .. "Pictures/"
  47.     user.screensavers = user.home .. "Screensavers/"
  48.     user.trash = user.home .. "Trash/"
  49.     user.settings = user.home .. "Settings.cfg"
  50.     user.versions = user.home .. "Versions.cfg"
  51.  
  52.     return user
  53. end
  54.  
  55. function paths.updateUser(...)
  56.     paths.user = paths.getUser(...)
  57. end
  58.  
  59. --------------------------------------------------------------------------------
  60.  
  61. return paths
  62.  
Tags: ORMS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement