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 #!/bin/bash
if ! grep "\boh-my-posh\b" ~/.bashrc if ! grep "\boh-my-posh\b" ~/.bashrc > /dev/null
then then
{ {
echo ""; echo "";
echo "# Oh My Posh!"; echo "# Oh My Posh!";
echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' 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; fi;