Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (15 sloc) 682 Bytes
require 'rake'
require 'fileutils'
require 'rubygems'
desc "Make complete setup of configuration files. Can be run multiple times."
task :setup do
shell_aliases_d = File.join(ENV['HOME'], ".shell_aliases.d")
File.delete(shell_aliases_d) if File.symlink?(shell_aliases_d)
Dir['*'].each do |file|
next if %w[README Rakefile Gemfile Gemfile.lock].include?(file)
source_file = File.join(Dir.pwd, file)
config_file = File.join(ENV['HOME'], ".#{file}")
File.symlink(source_file, config_file) unless File.exist?(config_file) || File.symlink?(config_file)
system("source #{ENV['HOME']}/.shell_aliases.d/ && compile_shell_aliases")