luadocs/content/lua.scripts.api.manual/dtutils/check_os.md
Bill Ferguson b69d752221 [lua scripts] created manual from script comments
[lua scripts api] created manual from embedded library documentation

[lua api] created stub to contain lua api manual
2020-12-12 15:14:19 -05:00

831 B

title id weight draft author
check_os check_os 30 false people

NAME

check_os

SYNOPSIS

check that the operating system is supported

USAGE

local du = require "lib/dtutils"
local result = du.check_os(operating_systems)

operating_systems - table - a table of operating system names such as {"windows","linux","macos","unix"}

DESCRIPTION

check_os checks a supplied table of operating systems against the operating system the script is running on and returns true if the OS is in the list, otherwise false

RETURN VALUE

result - boolean - true if the operating system is supported, false if not.

EXAMPLE

local du = require "lib/dtutils"
if du.check_os({"windows"}) then
  -- run the script
else
  dt.print("Script <script name> only runs on windows")
  return
end