fix(motd): git remote compare

This commit is contained in:
2024-04-01 22:52:24 +03:00
parent 71a8a1bd78
commit ecdd324701
3 changed files with 9 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env zsh
echo '"There is never enough time to do all the nothing you want."'
echo

View File

@@ -2,10 +2,13 @@
source "$HOME/.dotfiles/plugins/colors.plugin.zsh"
# update repo
git -C $HOME/.dotfiles remote update
local=$(git -C $HOME/.dotfiles rev-parse HEAD)
remote=$(git -C $HOME/.dotfiles rev-parse @{u})
if [[ ! -z $(git -C $HOME/.dotfiles status -uno) ]]; then
echo_yellow "You have home updates waiting to be pulled.\nUse \`hli\` to pull & install the changes."
if [[ $local != $remote ]]; then
echo_yellow "You have home updates waiting to be pulled/pushed."
echo_yellow "Use \`hp\` to push the local changes, or \`hli\` to pull & install the remote changes."
echo_yellow "Git status:\n"
git -C $HOME/.dotfiles status
echo
fi