Skip to content

Commit

Permalink
Change fixed path to a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ryukau committed Dec 4, 2023
1 parent 543478d commit b37e4c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions package/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def check_file(file_path):
exit(1)


def create_full_archive_from_github_actions_artifact(version):
def create_full_archive_from_github_actions_artifact(version, manual_root_dir: Path):
with open("manual.json", "r", encoding="utf-8") as fi:
manual_dict = json.load(fi)

Expand Down Expand Up @@ -51,12 +51,13 @@ def create_full_archive_from_github_actions_artifact(version):
)

# Do not make package if a plugin doesn't have manual.
if not Path(f"../docs/manual/{manual_name}").exists():
plugin_manual_dir = manual_root_dir / Path(f"{manual_name}")
if not plugin_manual_dir.exists():
print(f"Skipping {plugin_name}: manual not found")
continue

copy_resource(
Path(f"../docs/manual/{manual_name}"),
plugin_manual_dir,
vst3_dir / Path("Contents/Resources/Documentation"),
f"{plugin_name} manual was not found",
)
Expand All @@ -74,7 +75,7 @@ def create_full_archive_from_github_actions_artifact(version):
)


def create_macos_archive_from_github_actions_artifact(version):
def create_macos_archive_from_github_actions_artifact(version, manual_root_dir: Path):
"""
Ad-hoc method. Merge this to `create_full_archive_from_github_actions_artifact`
in future. Also remove `pack_macOS` line from `.github/workflows/build.yml`.
Expand Down Expand Up @@ -106,7 +107,8 @@ def create_macos_archive_from_github_actions_artifact(version):
)

# Do not make package if a plugin doesn't have manual.
if not Path(f"../docs/manual/{manual_name}").exists():
plugin_manual_dir = manual_root_dir / Path(f"{manual_name}")
if not plugin_manual_dir.exists():
print(f"Skipping {plugin_name}: manual not found")
continue

Expand Down Expand Up @@ -176,5 +178,6 @@ def get_version():

if __name__ == "__main__":
version = get_version()
create_macos_archive_from_github_actions_artifact(version)
create_full_archive_from_github_actions_artifact(version)
manual_root_dir = "../docs/manual/"
create_macos_archive_from_github_actions_artifact(version, manual_root_dir)
create_full_archive_from_github_actions_artifact(version, manual_root_dir)

0 comments on commit b37e4c7

Please sign in to comment.