27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/git_cli/os/linux/utils.rb', line 27
def Utils.is_installed?(binary)
if is_which_installed?
begin
GitCli::Global.instance.logger.debug "Checking if '#{binary}' is installed..."
res = Antrapol::ToolRack::ProcessUtilsEngine.exec("which #{binary}")
GitCli::Global.instance.logger.debug "Yes, '#{binary}' is found in system"
[true, res.strip]
rescue Exception => ex
GitCli::Global.instance.logger.debug "No, '#{binary}' is not found in system"
[false, ex.message]
end
else
raise GitCliException, "Utility 'which' is not installed"
end
end
|