fish 플러그인을 fisher 관리로 분리, ensure 함수 경로 탐색 개선

- fish completions/conf.d/functions를 dotfiles에서 제거 (fisher가 관리)
- config.fish + fish_plugins만 stow로 관리
- ensure 함수가 go/cargo/kitty 등 비표준 경로도 탐색
- install.sh에서 fisher 실행 전 stow 심링크 정리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-03-12 23:08:15 +09:00
parent 9fd587a6db
commit f9126603f5
47 changed files with 17 additions and 5738 deletions

View File

@@ -9,7 +9,13 @@ echo "==> OS: $OS / ARCH: $ARCH"
# 헬퍼 함수
# ──────────────────────────────────────────────────────────────────
ensure() {
if command -v "$1" &>/dev/null; then
# PATH 및 알려진 경로에서 검색
if command -v "$1" &>/dev/null \
|| [ -x "/usr/local/go/bin/$1" ] \
|| [ -x "$HOME/.cargo/bin/$1" ] \
|| [ -x "$HOME/go/bin/$1" ] \
|| [ -x "$HOME/.local/bin/$1" ] \
|| [ -x "$HOME/.local/kitty.app/bin/$1" ]; then
echo "$1 이미 설치됨"
return 1
fi
@@ -222,6 +228,14 @@ install_fish_plugins() {
return
fi
# stow된 플러그인 파일은 fisher와 충돌하므로,
# fish 플러그인은 stow가 아닌 fisher로 관리한다.
# fish_plugins 파일만 dotfiles에서 가져오고, 실제 설치는 fisher가 처리.
FISH_PLUGIN_DIRS=(completions conf.d functions)
for dir in "${FISH_PLUGIN_DIRS[@]}"; do
find "$HOME/.config/fish/$dir" -maxdepth 1 -type l -delete 2>/dev/null || true
done
$FISH_BIN -c '
if not functions -q fisher
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source
@@ -240,6 +254,8 @@ apply_dotfiles() {
echo "==> dotfiles 심링크 적용 중..."
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# fish 플러그인 파일은 fisher가 관리하므로 stow 충돌 방지
mkdir -p "$HOME/.config/fish"
stow -v --adopt -t "$HOME" fish git kitty nvim tmux
git checkout -- .
echo "==> dotfiles 적용 완료"