fish: GITEA_TOKEN 로드를 interactive shell로 한정

statusline 등 non-interactive fish가 매 호출마다 security CLI를
실행해 macOS 키체인 권한 다이얼로그가 반복적으로 뜨던 문제 수정.
Linux 분기와 동일한 set -q 가드로 통일.
This commit is contained in:
kappa
2026-05-02 08:30:56 +09:00
parent 6170388f8f
commit 8bb53d1e0e

View File

@@ -80,18 +80,25 @@ set -Ux EDITOR nvim
# ══════════════════════════════════════════════════════════════════
if test "$__os" = Darwin
# macOS: keychain에서 Gitea 토큰 로드
set -gx GITEA_TOKEN (security find-internet-password -s gitea.inouter.com -a kaffa -w 2>/dev/null)
# macOS: Lima 기반 컨테이너
alias docker "limactl shell docker -- docker"
alias podman "limactl shell podman -- podman"
alias ss='netstat -an'
else if test "$__os" = Linux
# Linux: 환경변수 또는 vault에서 Gitea 토큰 로드
alias ss='ss -tulnp'
end
# Gitea 토큰: interactive shell에서만 로드.
# (statusline/script 등 non-interactive fish가 매번 키체인을 두드려
# macOS에서 권한 다이얼로그가 뜨는 문제 방지)
if status is-interactive
if not set -q GITEA_TOKEN
if test "$__os" = Darwin
set -gx GITEA_TOKEN (security find-internet-password -s gitea.inouter.com -a kaffa -w 2>/dev/null)
else if test "$__os" = Linux
set -gx GITEA_TOKEN (vault kv get -field=api_token secret/apps/gitea 2>/dev/null || echo "")
end
alias ss='ss -tulnp'
end
end
# ══════════════════════════════════════════════════════════════════