16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/ranch_hand/base.rb', line 16
def self.install_ohmyzsh
RanchHand::Logger.info("installing ranch-hand Oh My Zsh shortcuts")
unless ENV['ZSH_CUSTOM'] || ENV['ZSH']
RanchHand::Logger.warn("Could not find $ZSH_CUSTOM or $ZSH in your environment, can not install shortcuts")
return
end
zsh_custom_dir = ENV['ZSH_CUSTOM'] || File.join(ENV['ZSH'], 'custom')
zsh_plugin_dir = File.join(zsh_custom_dir, 'plugins', 'ranch-hand')
FileUtils.mkdir_p(zsh_plugin_dir)
current_path = File.expand_path(File.dirname(__FILE__))
gem_plugin_path = File.join(current_path, '..', '..', 'files', 'ranch-hand.plugin.zsh')
FileUtils.cp(gem_plugin_path, zsh_plugin_dir)
RanchHand::Logger.info("installation complete")
RanchHand::Logger.info("Don't forget to add 'ranch-hand' to your plugins in ~/.zshrc -- e.g. plugins=(ranch-hand) -- and then 'source ~/.zshrc'")
end
|