Not meant to be called directly
.check_valid_util(util, utils = NULL, path = NULL)
util | name of target located in path |
---|---|
utils | name of supported targets in path |
path | path to directory |
safe path to util, or error if util does not exist
if (.Platform$OS.type == "unix") { # this will return /full/path/to/bin # or return an error for all values of util that are not "ls" and "pwd" # or error if "ls" does not exist in "/bin" .check_valid_util("ls", utils = c("ls", "pwd"), "/bin") if (FALSE) { # This will throw error .check_valid_util("badUtil", utils = c("ls", "pwd"), "/bin") } }