Skip to content

Instantly share code, notes, and snippets.

View TheBlckbird's full-sized avatar
🖥️

TheBlckbird TheBlckbird

🖥️
  • Germany
  • 04:53 (UTC +01:00)
View GitHub Profile
@Zbizu
Zbizu / getOS.lua
Last active September 26, 2024 16:16
operating system (OS) detection in Lua
function getOS()
-- ask LuaJIT first
if jit then
return jit.os
end
-- Unix, Linux variants
local fh,err = assert(io.popen("uname -o 2>/dev/null","r"))
if fh then
osname = fh:read()