Skip to content

Commit

Permalink
fix create package
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed May 10, 2024
1 parent 8323d86 commit e250bbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
14 changes: 4 additions & 10 deletions create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,25 +312,19 @@ def main(
if not output_dir:
output_dir = os.path.join(current_dir, "package")

version_filepath = os.path.join(current_dir, "version.py")
version_content = {}
with open(version_filepath, "r") as stream:
exec(stream.read(), version_content)
addon_version = version_content["__version__"]

addon_output_root = os.path.join(output_dir, ADDON_NAME)
new_created_version_dir = os.path.join(
addon_output_root, addon_version
addon_output_root, ADDON_VERSION
)
if os.path.isdir(new_created_version_dir):
log.info(f"Purging {new_created_version_dir}")
shutil.rmtree(output_dir)

fill_client_version(current_dir)

log.info(f"Preparing package for {ADDON_NAME}-{addon_version}")
log.info(f"Preparing package for {ADDON_NAME}-{ADDON_VERSION}")

addon_output_dir = os.path.join(output_dir, ADDON_NAME, addon_version)
addon_output_dir = os.path.join(output_dir, ADDON_NAME, ADDON_VERSION)
if not os.path.exists(addon_output_dir):
os.makedirs(addon_output_dir)

Expand All @@ -341,7 +335,7 @@ def main(
# Skip server zipping
if not skip_zip:
create_server_package(
current_dir, output_dir, addon_output_dir, addon_version, log
current_dir, output_dir, addon_output_dir, ADDON_VERSION, log
)
# Remove sources only if zip file is created
if not keep_sources:
Expand Down
3 changes: 0 additions & 3 deletions version.py

This file was deleted.

0 comments on commit e250bbc

Please # to comment.