From 4a798be4a0c3d408b2f31b2287798931beaa7ecc Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 31 Aug 2024 21:53:54 +0200 Subject: [PATCH] Add checks for programs if they are even installed --- programs.d/icons-in-terminal.sh | 2 +- programs.d/node-version-manager.sh | 2 +- programs.d/starship.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs.d/icons-in-terminal.sh b/programs.d/icons-in-terminal.sh index 2c37dcb..36aaddc 100755 --- a/programs.d/icons-in-terminal.sh +++ b/programs.d/icons-in-terminal.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -source "/usr/share/icons-in-terminal/icons_bash.sh" +[[ -f "/usr/share/icons-in-terminal/icons_bash.sh" ]] && source "/usr/share/icons-in-terminal/icons_bash.sh" diff --git a/programs.d/node-version-manager.sh b/programs.d/node-version-manager.sh index b353a2d..f6e45f9 100755 --- a/programs.d/node-version-manager.sh +++ b/programs.d/node-version-manager.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -source /usr/share/nvm/init-nvm.sh +[[ -f "/usr/share/nvm/init-nvm.sh" ]] && source /usr/share/nvm/init-nvm.sh diff --git a/programs.d/starship.sh b/programs.d/starship.sh index 76f265b..4b68c3d 100755 --- a/programs.d/starship.sh +++ b/programs.d/starship.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -eval "$(starship init bash)" +which starship &> /dev/null && eval "$(starship init bash)"