Comment

Comment by sxldier

I have a simple workflow I use for ENV vars. Another comment noted a script written which likely does more but I haven’t fully read the code. Here’s my simple workflow in case someone is interested.

Create a DB in MacOS keychain called envs:

  security create-keychain -P envs
Then use these shell functions:

  which get-env
  get-env () {
     security find-generic-password -s "$1" -w envs
   }

  which add-env
  add-env () {
      security add-generic-password -a "$USER" -s "$1" -w "$2" envs
   }
Then add one via:

  add-env ENVNAME SECRET
Example using it:

  ENVVAR=“$(get-env ENVNAME)” ./script.sh
parent sxldier 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton