os.lua 501 B

123456789101112131415161718
  1. local osname = "linux"
  2. if string.find(os.getenv("OS") or "", "Windows") then
  3. osname = "windows"
  4. end
  5. if osname == "linux" then
  6. -- travis ci failed to start date command?
  7. -- assert(os.execute("date") == 0)
  8. assert(os.execute("date -a") == 1)
  9. else
  10. assert(os.execute("date /T") == 0)
  11. assert(os.execute("md") == 1)
  12. end
  13. assert(os.getenv("PATH") ~= "")
  14. assert(os.getenv("_____GLUATEST______") == nil)
  15. assert(os.setenv("_____GLUATEST______", "1"))
  16. assert(os.getenv("_____GLUATEST______") == "1")