Don't run onefetch if you don't have it

This commit is contained in:
John Mertz 2023-10-24 11:17:35 -06:00
parent a429445a09
commit d1c4433dda
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,11 @@ fi
# If directory was just changed to the root of a git repository, print onefetch
if [ -n "$DIRCHANGED" ]; then
if [ -d "$PWD/.git" ]; then
${HOME}/bin/onefetch
if [[ "$(which onefetch)" == "" ]]; then
echo "This is a git directory, but you don't have 'onefetch' in your PATH"
else
onefetch
fi
fi
unset DIRCHANGED
fi