Clear build_dir before build

Intentionally uses os.path.exists without checking if it's a dir so that if it's a file or link an error is raised and the user sees that they're doing something really wrong somehow, somewhere
This commit is contained in:
David Zülke
2016-03-28 03:09:41 +02:00
parent 81beff804c
commit de2a44e310
+3
View File
@@ -2,6 +2,7 @@
import os
import envoy
import shutil
import sys
from tempfile import mkstemp, mkdtemp
@@ -110,6 +111,8 @@ class Formula(object):
def build(self):
# Prepare build directory.
if os.path.exists(self.build_path):
shutil.rmtree(self.build_path)
mkdir_p(self.build_path)
self.resolve_deps()