Fixing downloader
@@ -116,12 +116,16 @@ class Downloader(object):
def download(self, url, file_path=None, auth=None, retry=1, retry_wait=0, overwrite=False,
headers=None):
+ if file_path and not os.path.isabs(file_path):
+ file_path = os.path.abspath(file_path)
+
if file_path and os.path.exists(file_path):
if overwrite:
if self.output:
self.output.warn("file '%s' already exists, overwriting" % file_path)
else:
- # Should not happen, better to raise, probably we had to remove the dest folder before
+ # Should not happen, better to raise, probably we had to remove
+ # the dest folder before
raise ConanException("Error, the file to download already exists: '%s'" % file_path)
t1 = time.time()
