fix(dotfile): divers fix

This commit is contained in:
Anael Ginder
2026-09-18 11:24:31 +02:00
parent a9bb559f91
commit 58301d04c2
2 changed files with 25 additions and 26 deletions
+8 -5
View File
@@ -3,12 +3,14 @@
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTFILES_DIR="$SCRIPT_DIR/../dotfiles"
# Racine du dépôt : install/ et les packages (zellij, spaceship, zsh)
# sont au même niveau, donc on remonte d'un seul cran depuis install/.
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
log() { echo "[*] $*"; }
err() { echo "Erreur: $*" >&2; }
# usage: stow_config <nom_package_dotfiles> <répertoire_cible>
# usage: stow_config <nom_package> <répertoire_cible>
# Si le répertoire cible existe déjà, on ne touche à rien (idempotence
# non-destructive) : on suppose que la config est déjà en place.
stow_config() {
@@ -23,7 +25,7 @@ stow_config() {
mkdir -p "$target"
log "Stow du package '$package' vers $target ..."
(cd "$DOTFILES_DIR" && stow -vSt "$target" "$package")
(cd "$ROOT_DIR" && stow -vSt "$target" "$package")
}
# --- 1. Dépendances système ---
@@ -56,11 +58,11 @@ cargo install --locked zellij
stow_config "zellij" "$HOME/.config/zellij"
# --- 4. Zsh perso ---
# Le fichier reste nommé "zshrc.perso" (sans point) dans le dépôt dotfiles,
# Le fichier reste nommé "zshrc.perso" (sans point) dans le dépôt,
# mais on veut un symlink caché ~/.zshrc.perso. stow ne permet pas ce
# renommage nativement (sauf convention "dot-" qu'on ne veut pas imposer
# au dépôt), donc on crée le symlink manuellement.
ZSHRC_PERSO_SRC="$DOTFILES_DIR/zsh/zshrc.perso"
ZSHRC_PERSO_SRC="$ROOT_DIR/zsh/zshrc.perso"
ZSHRC_PERSO_DEST="$HOME/.zshrc.perso"
if [ -e "$ZSHRC_PERSO_DEST" ] || [ -L "$ZSHRC_PERSO_DEST" ]; then
@@ -95,3 +97,4 @@ log "Installation des outils Rust (bat, bottom, diskus, procs, cargo-update) ...
cargo install --locked bat bottom diskus procs cargo-update
log "Installation terminée avec succès."