fix: install.sh acceptait seulement l'entrée 'am' dans l'archive de release
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é.
This commit is contained in:
+19
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user