Sha256: 9e3c6a4d5bc7dd007033c8562b4b9a33bd13c21b275f92e865d6f69a7076bf01

Contents?: true

Size: 1.34 KB

Versions: 13

Compression:

Stored size: 1.34 KB

Contents

module BinInstall
  module Zsh
    module OhMyZsh
      INSTALL = %(sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)").freeze
      def self.require!
        abort('Oh My Zsh is required. Visit http://ohmyz.sh/ to install.'.red) unless installed?
      end

      def self.install
        puts 'Installing Oh My Zsh...'.white
        print_reload_warning
        if continue?
          system(INSTALL)
        else
          abort('Oh My Zsh installation aborted by user.'.red)
        end
      end

      def self.install!
        puts 'Installing Oh My Zsh...'.white
        print_reload_warning
        if continue?
          BinInstall.system!(INSTALL)
        else
          abort('Oh My Zsh installation aborted by user.'.red)
        end
      end

      def self.print_reload_warning
        return if installed?
        puts 'Warning Oh My Zsh requires reloading the shell.'.yellow
        puts 'After Oh My Zsh finishes installing.'.red
        puts "\n"
        puts 'Rerun the installer with:'
        puts '$ bin/install'.cyan
      end

      def self.continue?
        return true if installed?
        print 'Would you like to continue? [Y/n]: '
        Shell.default_yes?(gets.chomp)
      end

      def self.installed?
        File.exist?(File.expand_path('~/.oh-my-zsh'))
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bin_install-0.0.33 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.32 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.31 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.30 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.29 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.28 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.27 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.26 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.25 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.24 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.23 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.22 lib/bin_install/zsh/oh_my_zsh.rb
bin_install-0.0.21 lib/bin_install/zsh/oh_my_zsh.rb