Sha256: 58489c1dec5be8e96d4ca60a3469aa4dbdf57b6b81a53d701f884f8f57f06f03
Contents?: true
Size: 1.38 KB
Versions: 12
Compression:
Stored size: 1.38 KB
Contents
require 'bin_install/brew/cask' require 'bin_install/brew/package' require 'bin_install/brew/service' module BinInstall module Brew def self.require! if installed? update! else puts 'Homebrew is required.'.red puts 'Visit https://brew.sh/ for more information.' ask! abort('Can not continue without Homebrew.'.red) unless installed? end end def self.install puts 'Installing Homebrew...'.white system('/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"') end def self.install! puts 'Installing Homebrew...'.white BinInstall.system!('/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"') end def self.ask return if installed? print 'Would you like to install Homebrew? [Y/n]: ' install if Shell.default_yes?(gets.chomp) end def self.ask! print 'Would you like to install Homebrew? [Y/n]: ' install! if Shell.default_yes?(gets.chomp) end def self.update puts 'Updating Homebrew...'.white system('brew update') Cask.tap end def self.update! puts 'Updating Homebrew...'.white BinInstall.system!('brew update') Cask.tap! end def self.installed? Shell.executable_exists?('brew') end end end
Version data entries
12 entries across 12 versions & 1 rubygems