Permalink
Browse files

added uninstall to rakefile

  • Loading branch information...
1 parent 89892f2 commit 88d869cf8b498e82108a7f63393b71ed1882a599 Colin Rymer committed Oct 28, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 Rakefile
View
@@ -33,4 +33,25 @@ task :install do
`ln -s "$PWD/#{linkable}" "#{target}"`
end
end
+
+task :uninstall do
+
+ Dir.glob('**/*.symlink').each do |linkable|
+
+ file = linkable.split('/').last.split('.symlink').last
+ target = "#{ENV["HOME"]}/.#{file}"
+
+ # Remove all symlinks created during installation
+ if File.symlink?(target)
+ FileUtils.rm(target)
+ end
+
+ # Replace any backups made during installation
+ if File.exists?("#{ENV["HOME"]}/.#{file}.backup")
+ `mv "$HOME/.#{file}.backup" "$HOME/.#{file}"`
+ end
+
+ end
+end
+
task :default => 'install'

0 comments on commit 88d869c

Please sign in to comment.