helm/rake/pkg/emacs.rake

43 lines
1.1 KiB
Ruby
Raw Normal View History

2014-08-30 23:50:03 -07:00
if is_mac?
2014-08-30 23:50:03 -07:00
ENV['EMACS_D'] = File.expand_path("~/.emacs.d")
2014-08-30 23:50:03 -07:00
desc "Ensure emacs is installed and up to date"
task :emacs => "emacs:update"
namespace :emacs do
2014-07-17 05:18:53 -07:00
task :install do
2014-08-30 23:50:03 -07:00
unless Dir.exists?(ENV[:EMACS_D])
github 'hlissner/emacs.d', '~/.emacs.d'
Package.install "emacs", "--with-gnutls --cocoa --keep-ctags --srgb"
Package.install "homebrew/dupes/tidy", "--HEAD"
emacs_reqs.each { |pkg| Package.install pkg }
sh_safe "/usr/local/bin/npm install jshint -g"
sh_safe "/usr/local/bin/npm install jsonlint -g"
sh_safe "cd ~/.emacs.d && cask"
end
2014-07-17 05:18:53 -07:00
end
2014-07-17 05:18:53 -07:00
task :update do
2014-08-30 23:50:03 -07:00
echo "Updating emacs.d & packages"
sh_safe "cd ~/.emacs.d && git pull && cask update"
2014-07-17 05:18:53 -07:00
end
2014-08-30 23:50:03 -07:00
desc "Remove emacs & dependencies"
2014-07-17 05:18:53 -07:00
task :remove do
2014-08-30 23:50:03 -07:00
echo "Uninstalling emacs"
Package.remove "emacs"
Package.remove "homebrew/dupes/tidy"
emacs_reqs.each { |pkg| Package.remove pkg }
rm_rf "~/.emacs.d" if Dir.exists?(ENV['EMACS_D'])
2014-07-17 05:18:53 -07:00
end
2014-08-30 23:50:03 -07:00
end
def emacs_reqs
%w{aspell cask rsense}
end
end