17 lines
425 B
Bash
Executable File
17 lines
425 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
save-dotenv-to-pass() {
|
|
PASS_ENTRY=$(echo "dotenv/${PWD##*/}#$(git symbolic-ref --short -q HEAD)" | tr '[:upper:]' '[:lower:]')
|
|
DOTENV=".env"
|
|
if [[ -n "$1" ]]; then
|
|
DOTENV="$1"
|
|
fi
|
|
|
|
if [[ -f "$DOTENV" ]]; then
|
|
echo "Store $DOTENV file in pass: $PASS_ENTRY"
|
|
cat "$DOTENV" | pass insert -m -f "$PASS_ENTRY"
|
|
else
|
|
echo "No $DOTENV file found."
|
|
fi
|
|
}
|