How can I determine the OS of the system from within a Lua script?

前端 未结 5 1309
离开以前
离开以前 2021-02-12 12:36

Ok I need to determine the system\'s OS from a Lua script, but Lua as such has no API for this, so I use os.getenv() and query enviromental variables. On Windows checking the en

5条回答
  •  日久生厌
    2021-02-12 13:21

    Unixes should have the $HOME variable (while Windows doesn't have that), so you can check it (after checking the OS variable is empty).

提交回复
热议问题