fix(dotfiles): divers fix
This commit is contained in:
+26
-18
@@ -35,7 +35,7 @@ log "Mise à jour des paquets apt ..."
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
|
|
||||||
log "Installation des dépendances apt ..."
|
log "Installation des dépendances apt ..."
|
||||||
sudo apt -y install apt-transport-https curl gnupg stow zsh fzf
|
sudo apt -y install apt-transport-https curl gnupg stow zsh fzf zoxide
|
||||||
|
|
||||||
# --- 2. Rust / cargo ---
|
# --- 2. Rust / cargo ---
|
||||||
if ! command -v cargo >/dev/null 2>&1; then
|
if ! command -v cargo >/dev/null 2>&1; then
|
||||||
@@ -55,35 +55,43 @@ fi
|
|||||||
|
|
||||||
# --- 3. Zellij + sa config ---
|
# --- 3. Zellij + sa config ---
|
||||||
log "Installation de zellij ..."
|
log "Installation de zellij ..."
|
||||||
cargo install --locked zellij
|
#cargo install --locked zellij
|
||||||
|
|
||||||
stow_config "zellij" "$HOME/.config/zellij"
|
stow_config "zellij" "$HOME/.config/zellij"
|
||||||
|
|
||||||
# --- 4. Zsh perso ---
|
# --- 4. Zsh perso + zshrc principal ---
|
||||||
# Le fichier reste nommé "zshrc.perso" (sans point) dans le dépôt,
|
# Les fichiers restent nommés "zshrc" et "zshrc.perso" (sans point) dans le
|
||||||
# mais on veut un symlink caché ~/.zshrc.perso. stow ne permet pas ce
|
# dépôt, mais on veut des symlinks cachés ~/.zshrc et ~/.zshrc.perso. stow
|
||||||
# renommage nativement (sauf convention "dot-" qu'on ne veut pas imposer
|
# ne permet pas ce renommage nativement (sauf convention "dot-" qu'on ne
|
||||||
# au dépôt), donc on crée le symlink manuellement.
|
# veut pas imposer au dépôt), donc on crée les symlinks manuellement.
|
||||||
ZSHRC_PERSO_SRC="$DOTFILES_DIR/zsh/zshrc.perso"
|
|
||||||
ZSHRC_PERSO_DEST="$HOME/.zshrc.perso"
|
|
||||||
|
|
||||||
if [ -e "$ZSHRC_PERSO_DEST" ] || [ -L "$ZSHRC_PERSO_DEST" ]; then
|
link_dotfile() {
|
||||||
log "$ZSHRC_PERSO_DEST existe déjà, on ne touche à rien. Skip."
|
local src="$1"
|
||||||
else
|
local dest="$2"
|
||||||
if [ ! -f "$ZSHRC_PERSO_SRC" ]; then
|
|
||||||
err "Fichier source introuvable : $ZSHRC_PERSO_SRC"
|
if [ -e "$dest" ] || [ -L "$dest" ]; then
|
||||||
|
log "$dest existe déjà, on ne touche à rien. Skip."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$src" ]; then
|
||||||
|
err "Fichier source introuvable : $src"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
log "Création du symlink $ZSHRC_PERSO_DEST -> $ZSHRC_PERSO_SRC ..."
|
|
||||||
ln -s "$ZSHRC_PERSO_SRC" "$ZSHRC_PERSO_DEST"
|
log "Création du symlink $dest -> $src ..."
|
||||||
fi
|
ln -s "$src" "$dest"
|
||||||
|
}
|
||||||
|
|
||||||
|
link_dotfile "$DOTFILES_DIR/zsh/zshrc" "$HOME/.zshrc"
|
||||||
|
link_dotfile "$DOTFILES_DIR/zsh/zshrc.perso" "$HOME/.zshrc.perso"
|
||||||
|
|
||||||
# --- 5. Spaceship (prompt zsh) ---
|
# --- 5. Spaceship (prompt zsh) ---
|
||||||
SPACESHIP_DIR="$HOME/.zsh/spaceship-prompt"
|
SPACESHIP_DIR="$HOME/.zsh/spaceship-prompt"
|
||||||
|
|
||||||
if [ -d "$SPACESHIP_DIR/.git" ]; then
|
if [ -d "$SPACESHIP_DIR/.git" ]; then
|
||||||
log "Spaceship (upstream) déjà présent, mise à jour ..."
|
log "Spaceship (upstream) déjà présent, mise à jour ..."
|
||||||
git -C "$SPACESHIP_DIR" pull --ff-only
|
(cd "$HOME/.zsh" && git -C spaceship-prompt pull --ff-only)
|
||||||
elif [ -e "$SPACESHIP_DIR" ]; then
|
elif [ -e "$SPACESHIP_DIR" ]; then
|
||||||
log "$SPACESHIP_DIR existe mais n'est pas un dépôt git, on ne touche à rien. Skip."
|
log "$SPACESHIP_DIR existe mais n'est pas un dépôt git, on ne touche à rien. Skip."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user