- 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
483 B
Bash
Executable File
17 lines
483 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
load-dotenv-from-keepass() {
|
|
KEEPASS_ENTRY=$(echo "env/${PWD##*/}#$(git symbolic-ref --short -q HEAD)" | tr '[:upper:]' '[:lower:]')
|
|
DOTENV=".env"
|
|
if [[ -n "$1" ]]; then
|
|
DOTENV="$1"
|
|
fi
|
|
|
|
echo "Restore $DOTENV file from keepassxc: $KEEPASS_ENTRY"
|
|
keepassxc-cli attachment-export \
|
|
--key-file "$KEEPASS_DATABASE_KEY_FILE" \
|
|
"$KEEPASS_DATABASE_FILE" \
|
|
"$KEEPASS_ENTRY" \
|
|
"$DOTENV" \
|
|
"$DOTENV"
|
|
} |