Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (47 sloc) 1.543 kb
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 51 52 53
# Rakefile
#
# Simple tasks for managing my dot files and applications associated them.

FILES_TO_LINK = %w{ackrc gemrc gitconfig gitignore powconfig pryrc rspec secrets tmux.conf tmuxinator zshenv zshrc}

namespace :dot do

  desc 'Create symlinks'
  task :link do
    begin
      FILES_TO_LINK.each do |file|
        dot_file = File.expand_path("~/.#{file}")
        if File.exists? dot_file
          puts "#{dot_file} already exists, skipping link."
        else
          File.symlink(".dotfiles/#{file}", dot_file)
          puts "Created link for #{file} in your home folder."
        end
      end
    rescue NotImplementedError
      puts "File.symlink not supported, you must do it manually."
      if RUBY_PLATFORM.downcase =~ /(mingw|win)(32|64)/
        puts 'Windows 7 use mklink, e.g.'
        puts ' mklink _vimrc .vim\vimrc'
      end
    end
  end

  desc "Install oh-my-zsh"
  task :zsh do
    begin
      sh %{curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh}
      sh %{rm ~/.zshrc}
    rescue
      puts "Couldn't install oh-my-zsh. Are you connected to the internet?"
    end
  end
  
  desc "Install homebrew"
  task :brew do
    begin
      sh %{/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"}
    rescue
      puts "Couldn't install homebrew. Are you connected to the internet?"
    end
  end

  desc "Install ZSH, Homebrew, and symlink dotfiles"
  task :init => ["zsh","brew","link"] do
    puts "Installed Oh-My-ZSH, Homebrew and linked dotfiles!"
  end
end
Something went wrong with that request. Please try again.