added more checks for path existence

This commit is contained in:
Jenny Tam 2017-08-14 09:21:36 -07:00
parent bdad16e904
commit 2b2de0c272
2 changed files with 15 additions and 6 deletions

View file

@ -105,13 +105,16 @@ class BuildDriver(object):
source = input("Hit ENTER to reuse '" + self.source_path + "' or provide another path to the Source folder: ")
if len(source) == 0:
source = self.source_path
if os.path.exists( source ):
valid = True
if os.path.exists(source) and os.path.exists(os.path.join(source, 'shared')):
# Checking the existence of 'shared' folder only, assuming
# sqlsrv and/or pdo_sqlsrv are also present if it exists
self.source_path = source
break
else:
print('The path provided does not exist. Please re-enter.')
print("The path provided is invalid. Please re-enter.")
print('Copying source files from', source)
os.system('ROBOCOPY ' + source + '\shared ' + work_dir + '\Source\shared /xx /xo ')

View file

@ -111,9 +111,15 @@ class BuildUtil(object):
shutil.rmtree(os.path.join(phpsrc, 'Release_TS'), ignore_errors=True)
def remove_prev_build(self, sdk_dir):
"""Remove all binaries and source code in the Release* or Debug* folders"""
"""Remove all binaries and source code in the
Release* or Debug* folders according to the current
configuration
"""
print('Removing previous build...')
build_dir = self.build_abs_path(sdk_dir)
if not os.path.exists(build_dir):
return
os.chdir(build_dir)
os.system('DEL *sqlsrv*')