-
Notifications
You must be signed in to change notification settings - Fork 115
check_if_bin_exists
wpferguson edited this page Jun 14, 2020
·
1 revision
check_if_bin_exists
check if an executable exists
local df = require "lib/dtutils.file"
local result = df.check_if_bin_exists(bin)
bin - string - the binary to check for
check_if_bin_exists checks to see if the specified binary exists. check_if_bin_exists first checks to see if a preference for the binary has been registered and uses that if found. The presence of the file is verified, then quoted and returned. If no preference is specified and the operating system is linux then the which command is used to check for a binary in the path. If found that path is returned. If no binary is found, false is returned.
result - string - the sanitized path of the binary, false if not found