1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-10-31 22:05:58 +00:00

Avoid using workarounds in package script

* Just like the Windows package function counterpart, better abort building the package if the help and locale files have not been build instead of ignoring the error
This commit is contained in:
glubsy 2020-07-24 03:33:13 +02:00
parent f19b5d6ea6
commit 49a1beb225

View File

@ -43,14 +43,17 @@ def copy_files_to_package(destpath, packages, with_so):
shutil.copy("run.py", op.join(destpath, "run.py")) shutil.copy("run.py", op.join(destpath, "run.py"))
extra_ignores = ["*.so"] if not with_so else None extra_ignores = ["*.so"] if not with_so else None
copy_packages(packages, destpath, extra_ignores=extra_ignores) copy_packages(packages, destpath, extra_ignores=extra_ignores)
try: # include locale files if they are built otherwise exit as it will break
shutil.copytree(op.join("build", "help"), op.join(destpath, "help")) # the localization
except Exception as e: if not op.exists("build/locale"):
print(f"Warning: exception: {e}") print("Locale files not built, exiting...")
try: return
shutil.copytree(op.join("build", "locale"), op.join(destpath, "locale")) # include help files if they are built otherwise exit as they should be included?
except Exception as e: if not op.exists("build/help"):
print(f"Warning: exception: {e}") print("Help files not built, exiting...")
return
shutil.copytree(op.join("build", "help"), op.join(destpath, "help"))
shutil.copytree(op.join("build", "locale"), op.join(destpath, "locale"))
compileall.compile_dir(destpath) compileall.compile_dir(destpath)