refactors help.sh and functions.sh for improved logo display and adds trash notification; updates help.txt for clarity

This commit is contained in:
2024-11-09 04:09:15 +01:00
parent 58ba701f1f
commit 90fe3c8554
3 changed files with 10 additions and 7 deletions

View File

@ -17,9 +17,13 @@ is_wsl() {
logo() {
echo "Menno's Dotfiles" | figlet | lolcat
if [[ $(trash-list | wc -l) -gt 0 ]]; then
printfe "%s" "yellow" "[!] $(trash-list | wc -l | tr -d ' ') file(s) in trash - "
fi
# Print if repo is dirty and the count of untracked files, modified files and staged files
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
printfe "%s" "yellow" "dotfiles repo is dirty "
printfe "%s" "yellow" "dotfiles is dirty "
printfe "%s" "red" "[$(git -C ~/dotfiles status --porcelain | grep -c '^??')] untracked "
printfe "%s" "yellow" "[$(git -C ~/dotfiles status --porcelain | grep -c '^ M')] modified "
printfe "%s" "green" "[$(git -C ~/dotfiles status --porcelain | grep -c '^M ')] staged "
@ -29,6 +33,7 @@ logo() {
if [[ $(git -C ~/dotfiles log origin/master..HEAD) ]]; then
printfe "%s" "yellow" "[!] You have $(git -C ~/dotfiles log origin/master..HEAD --oneline | wc -l | tr -d ' ') commit(s) to push"
fi
println "" "normal"
}