mirror of
https://github.com/ryanvolz/radioconda.git
synced 2024-12-22 02:31:03 -05:00
Try to fix prefix in post-install script for OSX pkg installer.
The pkg installer does not have any environment variables (like $PREFIX) defined, but by inspection the other scripts that it executes set the PREFIX as $2/{installer_name}. So we do that when $PREFIX is not defined, which should cover all of the installers.
This commit is contained in:
parent
41c8754126
commit
73b77ae44d
14
rerender.py
14
rerender.py
@ -105,10 +105,20 @@ def render_constructor_specs(
|
||||
# write the post_install scripts referenced in the construct dict
|
||||
if platform.startswith("win"):
|
||||
with (constructor_dir / "post_install.bat").open("w") as f:
|
||||
f.write("\n".join((r"del /q %PREFIX%\pkgs\*.tar.bz2", "")))
|
||||
f.write("\n".join((r"del /q %PREFIX%\pkgs\*.tar.bz2", "exit 0", "")))
|
||||
else:
|
||||
with (constructor_dir / "post_install.sh").open("w") as f:
|
||||
f.write("\n".join((r"rm -f $PREFIX/pkgs/*.tar.bz2", "")))
|
||||
f.write(
|
||||
"\n".join(
|
||||
(
|
||||
"#!/bin/sh",
|
||||
f'PREFIX="${{PREFIX:-$2/{installer_name}}}"',
|
||||
r"rm -f $PREFIX/pkgs/*.tar.bz2",
|
||||
"exit 0",
|
||||
"",
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
construct_yaml_path = constructor_dir / "construct.yaml"
|
||||
with construct_yaml_path.open("w") as f:
|
||||
|
Loading…
Reference in New Issue
Block a user