Class: ZSH

Inherits:
Object
  • Object
show all
Defined in:
lib/zsh.rb

Class Method Summary collapse

Class Method Details

.installed?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/zsh.rb', line 3

def installed?
  file_or_folder_exists?('/.oh-my-zsh')
end

.updateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/zsh.rb', line 7

def update
  check_update_message('Oh My Zsh')

  Open3.popen3('env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh') do |stdin, stdout|
    output = stdout.read
    if output.include?('Current branch master is up to date')
      puts '  - Oh My Zsh already up to date.'.colorize(:green)
    else
      puts '  - Updating Oh My Zsh...'.colorize(:green)
      system 'env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh'
    end
  end
  break_output
end