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 task :io do
[ "pkg:update", [ "pkg:update",
"pkg:osx", "pkg:osx",
"pkg:nodejs",
"pkg:zsh", "pkg:zsh",
"pkg:vim", "pkg:vim",
"pkg:emacs", "pkg:emacs",
@ -16,7 +17,6 @@ task :io do
"imagealpha", "imagealpha",
"imageoptim", "imageoptim",
"xquartz", "xquartz",
"things",
"openemu", "openemu",
"transmit", "transmit",
"transmission", "transmission",

View file

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

View file

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