Skip to content

Instantly share code, notes, and snippets.

@mattly
Created November 11, 2009 20:54
Show Gist options
  • Select an option

  • Save mattly/232287 to your computer and use it in GitHub Desktop.

Select an option

Save mattly/232287 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# from http://errtheblog.com/posts/89-huba-huba
home = File.expand_path('~')
Dir['*'].each do |file|
next if file =~ /install.rb/
target = File.join(home, ".#{file}")
if File.exists?(target)
File.unlink(target)
end
`ln -s #{File.expand_path file} #{target}`
end
%w(env dir_aliases).each {|f| `touch #{home}/.#{f}` }
`mkdir #{home}/.zsh_cache` unless File.exists?("#{home}/.zsh_cache")
if File.exists?("#{home}/.id_dsa") && ! File.exists?('ssh/id_dsa')
`ln -s #{home}/.id_dsa ssh/id_dsa`
end
# git push on commit
`echo 'git push' > .git/hooks/post-commit`
`chmod 755 .git/hooks/post-commit`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment