Change Hooks
To take an action when an environment changes, you can use envkey-source like this:
$ envkey-source -r ./on-change.sh
Or use the es
alias:
$ es -r ./on-change.sh
Now every time the environment is updated, your on-change.sh
script will be run with the new environment. The environment variable __ENVKEY_UPDATED
will be set to a comma-delimited list of variables that changed in the latest update so you can take action based on what changed. The previous value of any variable that changed will also be set to __PREV_[VARIABLE_NAME]
.
Updated over 2 years ago