Files

8 lines
415 B
Bash
Executable File

#!/usr/bin/env bash
# Fake `pass`. Supports only: pass init <gpg-id> Env: FAKE_PASS_FAIL=1, FAKE_PASS_LOG
echo "pass $*" >> "${FAKE_PASS_LOG:-/dev/null}"
[[ -z "${FAKE_PASS_FAIL:-}" ]] || { echo "pass: simulated failure" >&2; exit 1; }
[[ "$1" == init ]] || { echo "fake pass: unsupported: $*" >&2; exit 1; }
dir="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
mkdir -p "$dir"; printf '%s\n' "$2" > "$dir/.gpg-id"