EAS does not remember dynamic environment variables set in the-preinstall hook

I am using eas-build-pre-install to point to a .sh files where some lines are in the form export ENV_VAR=value. It is required to be this way as the values are dynamically generated. However, upon starting the install step, these environment variables are blank. Is this expected behavior? If so, why? I am able to set npm config values from that file in a way that persists. Why not environment variables?

Yes, that is what I would expect, given how environment variables and shell scripts work on Unix.

Setting npm config likely writes the config to the ~./npmrc file, which would be read by later instances of npm.

Setting environment variables using the export command are just stored in the RAM of the current shell. When the shell script ends, so does the shell and the environment variables no longer exist.

1 Like

Thanks for the information :slight_smile:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.