-
Notifications
You must be signed in to change notification settings - Fork 115
check_os
wpferguson edited this page Jun 14, 2020
·
1 revision
check_os
check that the operating system is supported
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"}
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
result - boolean - true if the operating system is supported, false if not.
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