Skip to content

Commit

Permalink
create package adds license file
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Sep 30, 2024
1 parent 58f8194 commit 180c2c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,20 @@ def get_client_files_mapping() -> List[Tuple[str, str]]:
Returns:
list[tuple[str, str]]: List of path mappings to copy. The destination
path is relative to expected output directory.
"""
"""
# Add client code content to zip
client_code_dir: str = os.path.join(CLIENT_ROOT, ADDON_CLIENT_DIR)

return [
mapping = [
(path, os.path.join(ADDON_CLIENT_DIR, sub_path))
for path, sub_path in find_files_in_subdir(client_code_dir)
]

license_path = os.path.join(CURRENT_ROOT, "LICENSE")
if os.path.exists(license_path):
mapping.append((license_path, f"{ADDON_CLIENT_DIR}/LICENSE"))
return mapping


def get_client_zip_content(log) -> io.BytesIO:
log.info("Preparing client code zip")
Expand All @@ -275,6 +279,11 @@ def get_base_files_mapping() -> List[FileMapping]:
"package.py"
)
]
# Add license file to package if exists
license_path = os.path.join(CURRENT_ROOT, "LICENSE")
if os.path.exists(license_path):
filepaths_to_copy.append((license_path, "LICENSE"))

# Go through server, private and public directories and find all files
for dirpath in (SERVER_ROOT, PRIVATE_ROOT, PUBLIC_ROOT):
if not os.path.exists(dirpath):
Expand Down

0 comments on commit 180c2c7

Please sign in to comment.