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

42 lines
No EOL
831 B
Markdown

---
title: check_os
id: check_os
weight: 30
draft: false
author: "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
```