Use proper OS-specific path uris in many more places

also move path.join into local_path and output_path to simplify use
This commit is contained in:
Fabian Dill
2020-08-25 13:22:47 +02:00
parent 08f8677433
commit 2096d6ae5b
7 changed files with 33 additions and 30 deletions

View File

@@ -80,7 +80,7 @@ cx_Freeze.setup(
"build_exe": {
"includes": [],
"zip_include_packages": ["*"],
"zip_exclude_packages": ["maseya"],
"zip_exclude_packages": [],
"include_files": [],
"include_msvcr": True,
"replace_paths": [("*", "")],
@@ -91,15 +91,14 @@ cx_Freeze.setup(
)
def installfile(path):
def installfile(path, keep_content=False):
lbuildfolder = buildfolder
print('copying', path, '->', lbuildfolder)
if path.is_dir():
lbuildfolder /= path.name
if lbuildfolder.is_dir():
if lbuildfolder.is_dir() and not keep_content:
shutil.rmtree(lbuildfolder)
shutil.copytree(path, lbuildfolder)
shutil.copytree(path, lbuildfolder, dirs_exist_ok=True)
elif path.is_file():
shutil.copy(path, lbuildfolder)
else: