Created
June 4, 2024 08:08
-
-
Save myobie/503762eb086ae5b4a490e1448e6c584b to your computer and use it in GitHub Desktop.
Using 1password to inject ENV vars into the current shell from .env.* files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: eval "$(bin/dot-env)" | |
set -eo pipefail | |
PROJECT=$(git rev-parse --show-toplevel) | |
for f in ${PROJECT}/.env.*; do | |
echo "# ${f}" | |
op inject -i "$f" | |
echo "#" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment