Skip to content

Commit

Permalink
Fixes gf3#9
Browse files Browse the repository at this point in the history
  • Loading branch information
gf3 committed Aug 4, 2012
1 parent fd56bf9 commit dccb5ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'fileutils'

# Files
def entries
@files ||= Dir.entries( File.expand_path( '~/.dotfiles' ) ) - $exclude
@files ||= Dir.entries(File.expand_path('~/.dotfiles')) - $exclude
end

# Files and folders which shouldn't be copied over
Expand All @@ -20,10 +20,10 @@ $exclude = [

desc 'Backup previous dotfiles.'
task :backup do
dir = FileUtils.mkdir_p( File.expand_path( File.join( '~' , '.dotfiles-backup', Time.now.to_s ) ) )
entries.each do | file |
orig = File.expand_path( "~/#{file}" )
FileUtils.cp_r orig, "#{dir}/#{file}", :verbose => true if File.exists? orig
dir = FileUtils.mkdir_p(File.expand_path(File.join('~' , '.dotfiles-backup', Time.now.to_s)))
entries.each do |file|
orig = File.expand_path("~/#{file}")
FileUtils.cp_r orig, File.join(dir, file), :verbose => true if File.exists? orig
end
end

Expand All @@ -33,7 +33,7 @@ task :update do
end

desc 'Run all install tasks in order.'
task :install => [ 'install:deps', 'install:copy', 'install:post' ]
task :install => ['install:deps', 'install:copy', 'install:post']

namespace :install do

Expand All @@ -45,8 +45,8 @@ namespace :install do

desc 'Copy dotfiles over to home dir.'
task :copy do
entries.each do | file |
FileUtils.cp_r file, File.expand_path( "~/#{file}" ), :verbose => true, :remove_destination => true
entries.each do |file|
FileUtils.cp_r file, File.expand_path("~/#{file}"), :verbose => true, :remove_destination => true
end
end

Expand Down

0 comments on commit dccb5ce

Please sign in to comment.