From 38d38d51e3b2358bd4ac76eb124c28ce2d8fcfd5 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Thu, 20 Aug 2026 09:32:00 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20install.sh=20acceptait=20seulement=20l'e?= =?UTF-8?q?ntr=C3=A9e=20'am'=20dans=20l'archive=20de=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le pipeline CI publie am-linux-x86_64.tar.gz avec une entrée nommée 'am-linux-x86_64' (pas 'am') : le test [ -f $tmpdir/am ] échouait et le script retombait sur cargo install depuis les sources alors que le binaire précompilé existe. Recherche flexible du premier fichier extrait (am | am-$platform-$arch | n'importe quel fichier). Vérifié : extraction réelle du tar.gz v1.0.1 → ELF statique trouvé. --- install.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index dd7eaed..f88b1db 100644 --- a/install.sh +++ b/install.sh @@ -22,6 +22,13 @@ case "$arch" in *) fail "architecture non supportée: $arch" ;; esac +os=$(uname -s | tr '[:upper:]' '[:lower:]') +case "$os" in + linux) platform="linux" ;; + darwin) platform="macos" ;; + *) fail "système non supporté: $os" ;; +esac + install_from_source() { if ! command -v cargo >/dev/null 2>&1; then fail "pas de binaire précompilé pour $arch et cargo est absent — installez Rust (https://rustup.rs) puis relancez" @@ -45,14 +52,23 @@ fi installed="" if [ -n "$tag" ] && command -v curl >/dev/null 2>&1; then - asset="am-linux-$arch.tar.gz" + asset="am-$platform-$arch.tar.gz" url="$BASE_URL/releases/download/$tag/$asset" echo "Téléchargement de $url …" if curl -fsSL --connect-timeout 20 -o "$tmpdir/am.tar.gz" "$url"; then tar -xzf "$tmpdir/am.tar.gz" -C "$tmpdir" 2>/dev/null || true - if [ -f "$tmpdir/am" ]; then + # L'entrée de l'archive varie selon le pipeline CI : « am » ou + # « am-linux-x86_64 » (nom de la release). Prendre le premier fichier + # extrait. + bin="" + for cand in "$tmpdir/am" "$tmpdir/am-$platform-$arch" "$tmpdir/am-$arch" "$tmpdir"/*; do + if [ -f "$cand" ] && [ -z "$bin" ]; then + bin="$cand" + fi + done + if [ -n "$bin" ]; then mkdir -p "$INSTALL_DIR" - cp "$tmpdir/am" "$INSTALL_DIR/am" + cp "$bin" "$INSTALL_DIR/am" chmod +x "$INSTALL_DIR/am" installed=1 fi