Only register oh-my-posh if necessary

This commit is contained in:
Manuel Thalmann 2023-04-05 11:14:49 +02:00
parent b772868f73
commit 1952b9a14a

View file

@ -1,10 +1,11 @@
#!/bin/bash
if ! grep "\boh-my-posh\b" ~/.bashrc
if ! grep "\boh-my-posh\b" ~/.bashrc > /dev/null
then
{
echo "";
echo "# Oh My Posh!";
echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"'
} | tee -a ~/.bashrc;
echo 'eval "$(oh-my-posh completion bash)"';
} | tee -a ~/.bashrc > /dev/null;
fi;