From b772868f73a6730493918f3c1b6c741f1e69e974 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 5 Apr 2023 11:11:09 +0200 Subject: [PATCH] Install oh-my-posh only if necessary --- scripts/Common/Config/bash/oh-my-posh.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/Common/Config/bash/oh-my-posh.sh b/scripts/Common/Config/bash/oh-my-posh.sh index db32f513..6ee4f0f7 100755 --- a/scripts/Common/Config/bash/oh-my-posh.sh +++ b/scripts/Common/Config/bash/oh-my-posh.sh @@ -1,3 +1,10 @@ #!/bin/bash -echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' \ - | tee -a ~/.bashrc; +if ! grep "\boh-my-posh\b" ~/.bashrc +then + { + echo ""; + echo "# Oh My Posh!"; + echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' + } | tee -a ~/.bashrc; +fi; +