helm/rake/pkg/emacs.rake

49 lines
1.2 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-09-05 14:03:26 -07:00
unless Dir.exists? ENV[:EMACS_D]
2014-08-30 23:50:03 -07:00
github 'hlissner/emacs.d', '~/.emacs.d'
2014-09-05 14:03:26 -07:00
Package.install "homebrew/dupes/tidy --HEAD"
2014-08-30 23:50:03 -07:00
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-09-05 14:03:26 -07:00
# Update rsense config
sh_safe "~/.rbenv/shims/ruby `brew --prefix rsense`/libexec/etc/config.rb > ~/.rsense"
2014-07-17 05:18:53 -07:00
end
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 }
2014-09-05 14:03:26 -07:00
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
2014-09-05 14:03:26 -07:00
[
"emacs --with-gnutls --cocoa --keep-ctags --srgb",
"aspell --with-lang-en",
"cask",
"rsense"
]
2014-08-30 23:50:03 -07:00
end
end