(
installer,
install_dir,
example_path=None,
config_filename="construct.yaml",
timeout=420,
check=True,
)
| 298 | |
| 299 | |
| 300 | def _run_installer_pkg( |
| 301 | installer, |
| 302 | install_dir, |
| 303 | example_path=None, |
| 304 | config_filename="construct.yaml", |
| 305 | timeout=420, |
| 306 | check=True, |
| 307 | ): |
| 308 | if os.environ.get("CI"): |
| 309 | # We want to run it in an arbitrary directory, but the options |
| 310 | # are limited here... We can only install to $HOME :shrug: |
| 311 | # but that will pollute ~, so we only do it if we are running on CI |
| 312 | cmd = [ |
| 313 | "installer", |
| 314 | "-pkg", |
| 315 | installer, |
| 316 | "-dumplog", |
| 317 | "-target", |
| 318 | "CurrentUserHomeDirectory", |
| 319 | ] |
| 320 | if example_path: |
| 321 | install_dir = calculate_install_dir(example_path / config_filename) |
| 322 | install_dir = Path(os.environ["HOME"]) / install_dir |
| 323 | else: |
| 324 | # This command only expands the PKG, but does not install |
| 325 | warnings.warn( |
| 326 | "Not running installer, only expanding the PKG. " |
| 327 | "Export CI=1 to run it, but it will pollute your $HOME." |
| 328 | ) |
| 329 | cmd = ["pkgutil", "--expand", installer, install_dir] |
| 330 | return _execute(cmd, timeout=timeout, check=check), install_dir |
| 331 | |
| 332 | |
| 333 | def _sentinel_file_checks(example_path, install_dir): |
no test coverage detected