Files
git.taskfile.build/bin/load-dotenv-from-keepass
T
Janik von Rotz 464cb5cbad feat(ci): refactor build-and-deploy workflow with consistent formatting and dynamic dotenv handling
- 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
2026-01-16 11:31:05 +01:00

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"
}