From 936147ecf6362e9ef75b5b6f9997ec62b638b790 Mon Sep 17 00:00:00 2001 From: Votre Nom Date: Sun, 26 Apr 2026 11:12:15 +0200 Subject: [PATCH] chore: add redeploy.sh for /usr/local/bin install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds workspace release, backs up existing binaries, installs cosmic-applets/cosmic-app-list/cosmic-panel-button to /usr/local/bin (precedence over pacman package via $PATH). Leyoda 2026 – GPLv3 --- redeploy.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 redeploy.sh diff --git a/redeploy.sh b/redeploy.sh new file mode 100755 index 00000000..7138a806 --- /dev/null +++ b/redeploy.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Recompile et déploie le fork local cosmic-applets (multiplexor cosmic-applets + +# binaire séparé cosmic-app-list). +# +# Cibles : /usr/local/bin/cosmic-applets et /usr/local/bin/cosmic-app-list +# (binaires compilés manuellement, hors pacman, qui priment sur ceux du paquet +# via $PATH /usr/local/bin avant /usr/bin). +# +# Branche de déploiement : yoda-dock-magnification (contient les commits +# magnification + le fix Wayland error handling). + +set -euo pipefail + +REPO="/home/lionel/Devels/cosmic-applets" +TARGETS=( + "cosmic-applets" + "cosmic-app-list" + "cosmic-panel-button" +) +BIN_DIR="/usr/local/bin" + +cd "$REPO" + +echo "==> Branche actuelle : $(git branch --show-current)" +echo "==> Build release (workspace)..." +cargo build --release --workspace + +STAMP=$(date +%Y%m%d-%H%M%S) +for bin in "${TARGETS[@]}"; do + src="$REPO/target/release/$bin" + dst="$BIN_DIR/$bin" + + if [[ ! -f "$src" ]]; then + echo "!! Binaire absent après build : $src" >&2 + exit 1 + fi + + if [[ -f "$dst" ]]; then + echo "==> Backup $dst" + sudo cp -a "$dst" "${dst}.bak.${STAMP}" + fi + + echo "==> Install $src -> $dst" + sudo install -m755 "$src" "$dst" +done + +echo "==> Kill des process applet en cours (cosmic-panel relancera à la demande)" +pkill -u "$USER" -f "/usr/local/bin/cosmic-applet" || true +pkill -u "$USER" -f "/usr/local/bin/cosmic-app-list" || true +pkill -u "$USER" -f "/usr/local/bin/cosmic-panel-button" || true + +echo "==> Vérif" +for bin in "${TARGETS[@]}"; do + file "$BIN_DIR/$bin" +done +echo "OK — relogin recommandé pour repartir sur des process applet propres."