Update system rakefiles

This commit is contained in:
Henrik Lissner 2015-02-02 02:02:56 -05:00
parent 94a5a4106b
commit 607dce2606
3 changed files with 8 additions and 7 deletions

View file

@ -2,6 +2,7 @@ desc "My main computer"
task :io do
[ "pkg:update",
"pkg:osx",
"pkg:nodejs",
"pkg:zsh",
"pkg:vim",
"pkg:emacs",
@ -16,7 +17,6 @@ task :io do
"imagealpha",
"imageoptim",
"xquartz",
"things",
"openemu",
"transmit",
"transmission",

View file

@ -21,9 +21,7 @@ if is_mac?
def setup_node
echo "Installing node dependencies"
node_reqs.each do |pkg|
sh_safe "/usr/local/bin/npm install -g #{pkg}"
end
sh_safe "/usr/local/bin/npm install -g #{node_reqs.join(' ')}"
end
def setup_emacs_d
@ -60,10 +58,13 @@ if is_mac?
end
task :update => "emacs:install" do
if emacs_installed?
if emacs_installed? && Dir.exists?("#{ENV['EMACS_D']}/.git")
echo "Updating emacs.d & packages"
sh_safe "cd '#{ENV["EMACS_D"]}' && git pull && cask update"
# Update node
sh_safe "/usr/local/bin/npm update -g #{node_reqs.join(' ')}"
# Update rsense config
sh_safe "/usr/bin/env ruby `brew --prefix rsense`/libexec/etc/config.rb > ~/.rsense"
end

View file

@ -17,7 +17,7 @@ namespace :zsh do
unless `printenv SHELL | grep "/zsh$"`
echo "Setting shell to ZSH", 2
zsh_bin = is_mac? ? "/usr/local/bin/zsh" : "/usr/bin/zsh"
if !File.exists? zsh_bin
unless File.exists? zsh_bin
error "ZSH isn't in #{File.dirname(zsh_bin)}"
next
end
@ -28,7 +28,7 @@ namespace :zsh do
sh_safe "echo '#{zsh_bin}' | sudo tee -a /etc/shells"
end
sh_safe "chsh -s #{zsh_bin}"
sh "chsh -s #{zsh_bin}"
end
echo "Comment out path_helper to fix PATH in emacs!" if is_mac?