cache secrets to file, fix spinner animation
This commit is contained in:
@@ -28,10 +28,14 @@ if ! command -v bw &>/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- Get secrets (cached in env vars, or fetch from Bitwarden) ---
|
||||
# --- Get secrets (cached in file, or fetch from Bitwarden) ---
|
||||
|
||||
if [ -n "${HANTIM_GITEA_TOKEN:-}" ]; then
|
||||
echo "Using cached secrets from environment."
|
||||
SECRETS_CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/hantim-secrets"
|
||||
|
||||
if [ -f "$SECRETS_CACHE" ]; then
|
||||
echo "Using cached secrets."
|
||||
# shellcheck source=/dev/null
|
||||
source "$SECRETS_CACHE"
|
||||
GITEA_TOKEN="$HANTIM_GITEA_TOKEN"
|
||||
else
|
||||
if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then
|
||||
@@ -46,8 +50,6 @@ else
|
||||
|
||||
bw sync --session "${BW_SESSION:-}"
|
||||
GITEA_TOKEN=$(bw get notes hantim-new-app-script --session "${BW_SESSION:-}")
|
||||
|
||||
export HANTIM_GITEA_TOKEN="$GITEA_TOKEN"
|
||||
fi
|
||||
|
||||
# --- Delete Gitea repo ---
|
||||
|
||||
Reference in New Issue
Block a user