Commits

Anonymous committed 1feec38

Remove clone destination directory if it already exists

Comments (0)

Files changed (1)

mercurialrecipe/__init__.py

 import os
+import shutil
 import logging
 from mercurial import commands, ui, hg
 
 	
 	def install(self):
 		self.log.info("Cloning repository %s to %s" % (self.source, self.destination))
+		shutil.rmtree(self.destination, ignore_errors = True)
 		commands.clone(ui.ui(), get_repository(self.source), self.destination)
 		return self.destination