class RedmineInstaller::Easycheck

Constants

EASYCHECK_SH

Public Class Methods

run() click to toggle source
# File lib/redmine-installer/easycheck.rb, line 9
def self.run
  Bundler.with_clean_env do
    if Kernel.system('which', 'wget')
      Open3.pipeline(['wget', EASYCHECK_SH, '-O', '-', '--quiet'], 'bash')

    elsif Kernel.system('which', 'curl')
      Open3.pipeline(['curl', EASYCHECK_SH, '--output', '-', '--silent'], 'bash')

    else
      error 'Neither wget nor curl was found'
    end
  end

  puts
  if !prompt.yes?('Continue?')
    error 'Canceled'
  end
end