Files
git.taskfile.build/bin/load-dotenv-from-pass
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
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
}