From e42e40f4fe9e851022208e3d2fc0cca55dc3a93a Mon Sep 17 00:00:00 2001 From: Logikisto <1+logikisto@noreply.git.rv0.fr> Date: Thu, 10 Sep 2026 15:33:14 +0200 Subject: [PATCH] Actualiser install.sh --- install.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index ac29c86..47533d9 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ BASHRC="$HOME/.bashrc" MARKER_START="# >>> c-run setup >>>" MARKER_END="# <<< c-run setup <<<" -# Crée le .bashrc s'il n'existe pas (cas très rare) +# Crée le .bashrc s'il n'existe pas touch "$BASHRC" # Supprime l'ancienne version de la fonction si elle existe @@ -49,9 +49,10 @@ c-run() { # <<< c-run setup <<< EOF -# Recharge le .bashrc si on est bien dans un shell interactif -if [ -n "$BASH_VERSION" ]; then - source "$BASHRC" -fi +# Recharge le .bashrc dans le shell courant +source "$BASHRC" -exit 0 \ No newline at end of file +# Utilise 'return' au lieu de 'exit' pour ne pas fermer le terminal de l'utilisateur +# si le script est sourcé. Si le script est exécuté normalement (sh install.sh), +# le 'return' va simplement ignorer l'erreur silencieusement. +return 0 2>/dev/null || exit 0 \ No newline at end of file