|
|
@ -22,14 +22,14 @@ fi |
|
|
|
|
|
|
|
check_rc_update () { |
|
|
|
# Get rc dir path |
|
|
|
RC_PATH=$(dirname "$(readlink -f ${(%):-%x})") |
|
|
|
RC_PATH=$(dirname "$(realpath -- "${(%):-%x}")") |
|
|
|
|
|
|
|
CUR_DIR=`pwd` |
|
|
|
CUR_DIR="$(pwd)" |
|
|
|
cd $RC_PATH |
|
|
|
|
|
|
|
# In case the network is down, don't lock the terminal |
|
|
|
timeout 6 git fetch > /dev/null 2>&1 |
|
|
|
# |
|
|
|
GIT_SSH_COMMAND='ssh -oBatchMode=yes' GIT_TERMINAL_PROMPT=0 timeout 6 git fetch > /dev/null 2>&1 |
|
|
|
|
|
|
|
# Timeout returns 124 on timeout |
|
|
|
if [ "$?" -ge "124" ]; then |
|
|
|
echo 'git_network_unreachable' >> /dev/shm/prompt_msg |
|
|
@ -37,9 +37,9 @@ check_rc_update () { |
|
|
|
|
|
|
|
# Check if the repo is clean |
|
|
|
git_st=$(command git status --porcelain -b 2> /dev/null) |
|
|
|
if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then |
|
|
|
if $(echo "$git_st" | grep '^## .*ahead' > /dev/null 2>&1); then |
|
|
|
echo 'git_unpushed' >> /dev/shm/prompt_msg |
|
|
|
elif $(echo "$git_st" | grep '^## .*behind' &> /dev/null); then |
|
|
|
elif $(echo "$git_st" | grep '^## .*behind' > /dev/null 2>&1); then |
|
|
|
echo 'update_rc' >> /dev/shm/prompt_msg |
|
|
|
fi |
|
|
|
|
|
|
@ -48,7 +48,7 @@ check_rc_update () { |
|
|
|
|
|
|
|
check_sys_update () { |
|
|
|
case $(lsb_release -i | awk -F ':\t' '/Distributor ID/{print $2}') in |
|
|
|
Arch) |
|
|
|
Arch|Artix) |
|
|
|
nb_maj=$(checkupdates | wc -l);; |
|
|
|
Debian|Ubuntu) |
|
|
|
nb_maj=$(aptitude search '~U' | wc -l);; |
|
|
|