Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to $PATH during post install script #136

Open
VicenteCantonPaterna opened this issue Mar 15, 2023 · 1 comment
Open

Access to $PATH during post install script #136

VicenteCantonPaterna opened this issue Mar 15, 2023 · 1 comment

Comments

@VicenteCantonPaterna
Copy link

VicenteCantonPaterna commented Mar 15, 2023

First of all, thank you very much for the amazing tool you have made. I would like to know if is it possible to access the user's $PATH variable while running the postinstall script. I am trying to copy the $PATH into a plist file so that it has access to some installed commands, but after installation the copied $PATH is empty (or it does not contain same values as when I run $PATH in a terminal).

I checked the docs and I see some env variables available like INSTALL_PKG_SESSION_ID, but I could not find anything about $PATH. Is it available under some other name? If not, would it be possible to access it somehow? Thanks!

Edit: this is what gets pasted running echo $PATH >> file inside the script:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec

@packagesdev
Copy link
Owner

It's not possible as far as I know as the script is run in an environment that is not the one of the current user (if the package does not request admin authentication) or the super user (if the package requires admin authentication).

For the record, it's strongly recommended to use absolute paths for commands run from a pre- or post- installations script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants