This commit is contained in:
muratayusuke
2013-06-09 23:10:21 +00:00
parent e817c816c9
commit e530df7239
2 changed files with 12 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ class Homesick
say_status :conflict, "#{destination} exists", :red unless options[:quiet]
if options[:force] || shell.file_collision(destination) { source }
system "rm -rf #{destination}" unless options[:pretend]
system "ln -sf #{source} #{destination}" unless options[:pretend]
end
else

View File

@@ -119,6 +119,17 @@ describe "homesick" do
existing_dotdir_link.readlink.should == dotdir
end
it "can override existing directory" do
somewhere_else = create_construct
existing_dotdir = home.directory(".vim")
dotdir = castle.directory(".vim")
homesick.symlink("glencairn")
existing_dotdir.readlink.should == dotdir
end
end
context "with '.config' in .homesick_subdir" do