Sha256: 1c547e62661a215cd5b8058b6d7ad54bf0afba515d2b264bc736a64b1c1b98e9

Contents?: true

Size: 969 Bytes

Versions: 10

Compression:

Stored size: 969 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 remote #{name}.".blue
      else
        puts "Adding remote #{name} for #{url}...".white
        system("git remote add #{name} #{url}")
      end
    end

    def self.add_remote!(name, url)
      if remote?(name)
        puts "Remote #{name} already exists. Skipping remote #{name}.".blue
      else
        puts "Adding remote #{name} for #{url}...".white
        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

10 entries across 10 versions & 1 rubygems

Version Path
bin_install-0.0.33 lib/bin_install/git.rb
bin_install-0.0.32 lib/bin_install/git.rb
bin_install-0.0.31 lib/bin_install/git.rb
bin_install-0.0.30 lib/bin_install/git.rb
bin_install-0.0.29 lib/bin_install/git.rb
bin_install-0.0.28 lib/bin_install/git.rb
bin_install-0.0.27 lib/bin_install/git.rb
bin_install-0.0.26 lib/bin_install/git.rb
bin_install-0.0.25 lib/bin_install/git.rb
bin_install-0.0.24 lib/bin_install/git.rb