1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# == Description # I modified the original[http://errtheblog.com/posts/89-huba-huba] to do a bit more. I work in different environments. Linux, Mac, and even Windows. I hate keeping track of all this dotfile nonsense so here is how my install script works. # # # $ ./.install mac # $ ./.install cygwin # $ ./.install linux # $ ./.install mac bashrc # for help(not much): $ ./.install # # Of course, these are all dependent on shell(I use bash) and setup and blah blah blah. But you can take this install script and win at life(computer life only) in any environment. To add a new environment just create a new folder and off you go. # # == Features # * multiple environments # * install single files # * support for config directories(.irssi for example) # # == TODO # * be less lame # * named arguments?(--files=??) # * a common folder to guard against duplication(probably need to use named arguments) # * named arguments are so frustrating #!/usr/bin/env ruby # from http://errtheblog.com/posts/89-huba-huba if ARGV[0] puts "Here are your configs: " puts "usage: CONFIG [FILE]" puts "want to see what's out there? me too: --list" exit elsif ARGV[0] == '--list' Dir['*'] do |config| puts ":" Dir["/*"] {|file| puts " - "} end exit end home = File('~') Dir["/"] do |file| target = File(home, ".") `ln -f -h -s -i ` # we need all these options (f and h) in order to prevent looped symlinks for dotdirectories end # git push on commit `echo 'git push' > .git/hooks/post-commit` `chmod 755 .git/hooks/post-commit` |
Pastie