helm/rake/pkg/zsh.rake

34 lines
850 B
Ruby
Raw Normal View History

require_relative '../lib/sh'
require_relative '../lib/git'
2014-04-11 00:31:44 -07:00
desc "Ensure zsh and oh-my-zsh is installed and set"
task :zsh => 'zsh:update'
namespace :zsh do
task :install do
2014-07-29 02:24:29 -07:00
unless Dir.exists?(File.expand_path("~/.zprezto"))
echo "Installing prezto"
github 'hlissner/prezto', '~/.zprezto'
2014-04-11 00:31:44 -07:00
end
sh_safe '~/.dotfiles/install.sh'
2014-04-11 00:31:44 -07:00
unless `printenv SHELL | grep "/bin/zsh"`
echo "Setting shell to zsh"
2014-06-15 22:24:05 -07:00
sh_safe "chsh -s /bin/zsh"
sh_safe "exec /bin/zsh -l"
2014-04-11 00:31:44 -07:00
end
end
2014-06-17 19:28:52 -07:00
task :update => "zsh:install" do
2014-07-29 02:24:29 -07:00
echo "Updating zprezto"
sh_safe 'cd ~/.zprezto && git pull'
# TODO: pull from parent repo
2014-04-11 00:31:44 -07:00
end
2014-04-13 08:46:20 -07:00
task :remove do
2014-07-29 02:24:29 -07:00
sh_safe 'rm -rf ~/.zprezto' if Dir.exists?(File.expand_path("~/.zprezto"))
2014-04-13 08:46:20 -07:00
end
2014-04-11 00:31:44 -07:00
end