Sha256: 9eeedf2092dcd1c2abd22b091039e7f6222420a537e4178c1249a7aba9f90e02

Contents?: true

Size: 825 Bytes

Versions: 12

Compression:

Stored size: 825 Bytes

Contents

module BinInstall
  module Git
    def self.install
      puts 'Installing Git...'.white
      Brew::Package.install_or_upgrade('git')
    end

    def self.install!
      puts 'Installing Git...'.white
      Brew::Package.install_or_upgrade!('git')
    end

    def self.add_remote(name, url)
      if remote?(name)
        puts "Remote #{name} already exists. Skipping.".blue
      else
        system("git remote add #{name} #{url}")
      end
    end

    def self.add_remote!(name, url)
      if remote?(name)
        puts "Remote #{name} already exists. Skipping.".blue
      else
        BinInstall.system!("git remote add #{name} #{url}")
      end
    end

    def self.remote?(name)
      system("git remote get-url #{name}")
    end

    def self.installed?
      Shell.executable_exists?('git')
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bin_install-0.0.20 lib/bin_install/git.rb
bin_install-0.0.19 lib/bin_install/git.rb
bin_install-0.0.18 lib/bin_install/git.rb
bin_install-0.0.17 lib/bin_install/git.rb
bin_install-0.0.16 lib/bin_install/git.rb
bin_install-0.0.15 lib/bin_install/git.rb
bin_install-0.0.14 lib/bin_install/git.rb
bin_install-0.0.13 lib/bin_install/git.rb
bin_install-0.0.12 lib/bin_install/git.rb
bin_install-0.0.11 lib/bin_install/git.rb
bin_install-0.0.10 lib/bin_install/git.rb
bin_install-0.0.9 lib/bin_install/git.rb