diff --git a/install.sh b/install.sh index c2d60cd..643f130 100755 --- a/install.sh +++ b/install.sh @@ -63,9 +63,14 @@ trap cleanup EXIT # ── Installation fzf ────────────────────────────────────────────── _install_fzf_binary() { - local fzf_url="https://github.com/junegunn/fzf/releases/latest/download/fzf-linux_amd64.tar.gz" local tmp_fzf="/tmp/fzf_$$.tar.gz" - info "Téléchargement fzf depuis GitHub Releases..." + info "Récupération de la version fzf depuis GitHub API..." + local fzf_ver + fzf_ver=$(curl -fsSL "https://api.github.com/repos/junegunn/fzf/releases/latest" \ + | grep '"tag_name"' | head -1 | awk -F'"' '{print $4}') + [[ -z "$fzf_ver" ]] && { err "Impossible de déterminer la version fzf."; exit 1; } + local fzf_url="https://github.com/junegunn/fzf/releases/download/${fzf_ver}/fzf-${fzf_ver}-linux_amd64.tar.gz" + info "Téléchargement fzf ${fzf_ver}..." curl -fsSL "$fzf_url" -o "$tmp_fzf" mkdir -p "$HOME/.local/bin" tar -xzf "$tmp_fzf" -C "$HOME/.local/bin/" fzf