Method: App::UtilsTools.check_sshpass_is_installed
- Defined in:
- lib/core/utils_tools.rb
.check_sshpass_is_installed ⇒ Object
Check that SSHPASS is installed.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/core/utils_tools.rb', line 39 def self.check_sshpass_is_installed if @sshpass_installed.nil? sshpass_result = App::Terminal::command_capture('sshpass -h', nil, false, false) sshpass_result = sshpass_result[0].split(' ') unless sshpass_result[0].downcase == 'usage:' if this_is_a_mac = "Find how to install it at: #{App::Terminal::format_highlight('https://www.google.co.uk/search?q=install+sshpass+on+mac')}" else = "Install it using: #{App::Terminal::format_command('sudo apt-get install sshpass')}" end App::Terminal::error("#{App::Terminal::format_highlight('sshpass')} is not installed", , true) end @sshpass_installed = true end end |