()
| 241 | |
| 242 | |
| 243 | def main() -> None: |
| 244 | parser = argparse.ArgumentParser(description=(__doc__ or "").splitlines()[0]) |
| 245 | parser.add_argument( |
| 246 | "--staging-dir", |
| 247 | type=Path, |
| 248 | default=REPO_DIR / "dist" / "signed", |
| 249 | help="Directory holding scenedetect-signed.zip and PySceneDetect-*-win64.zip.", |
| 250 | ) |
| 251 | args = parser.parse_args() |
| 252 | |
| 253 | staging = args.staging_dir.resolve() |
| 254 | if not staging.is_dir(): |
| 255 | sys.exit(f"{staging} not found") |
| 256 | |
| 257 | signed_bundle = staging / "scenedetect-signed.zip" |
| 258 | portable_zip = staging / f"PySceneDetect-{VERSION}-win64.zip" |
| 259 | if not signed_bundle.is_file(): |
| 260 | sys.exit(f"{signed_bundle} not found") |
| 261 | if not portable_zip.is_file(): |
| 262 | sys.exit(f"{portable_zip} not found") |
| 263 | |
| 264 | sevenz = find_7zip() |
| 265 | print(f"Using 7-Zip: {sevenz}") |
| 266 | print(f"Staging dir: {staging}") |
| 267 | print(f"Version: {VERSION}") |
| 268 | |
| 269 | with tempfile.TemporaryDirectory() as tmp: |
| 270 | signed_exe, signed_msi = extract_signed_bundle(signed_bundle, Path(tmp)) |
| 271 | repack_portable(portable_zip, signed_exe, sevenz) |
| 272 | msi_dest = staging / signed_msi.name |
| 273 | shutil.copy2(signed_msi, msi_dest) |
| 274 | print(f"Copied signed MSI -> {msi_dest.name}") |
| 275 | write_manifests(staging, portable_zip, msi_dest) |
| 276 | |
| 277 | |
| 278 | if __name__ == "__main__": |
no test coverage detected