- Standardized YAML indentation and quoting in build-and-deploy workflow - Enhanced dotenv scripts to support custom .env file paths and dynamic entry naming based on project and branch - Added new `show-dotenv` utility to display dotenv configuration details - Updated documentation to reflect dynamic entry resolution and new command options - Fixed minor typos and improved consistency in patterns.md and library.md
17 lines
429 B
Bash
Executable File
17 lines
429 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
load-dotenv-from-pass() {
|
|
PASS_ENTRY=$(echo "env/${PWD##*/}#$(git symbolic-ref --short -q HEAD)" | tr '[:upper:]' '[:lower:]')
|
|
DOTENV=".env"
|
|
if [[ -n "$1" ]]; then
|
|
DOTENV="$1"
|
|
fi
|
|
|
|
if pass find "$PASS_ENTRY" >/dev/null; then
|
|
echo "Restore $DOTENV file from pass: $PASS_ENTRY"
|
|
pass show "$PASS_ENTRY" > $DOTENV
|
|
else
|
|
echo "Pass entry not found."
|
|
fi
|
|
}
|