- correctif fonctions git
This commit is contained in:
parent
c209b6451c
commit
4eb4b0acb4
50
func/git.sh
50
func/git.sh
|
|
@ -61,33 +61,37 @@ gitssl() {
|
|||
}
|
||||
|
||||
script_update() {
|
||||
local BRANCH LOCAL REMOTE
|
||||
local BRANCH LOCAL REMOTE
|
||||
|
||||
cd "$WELCOME_SCRIPT_PATH" || return 2
|
||||
cd "$WELCOME_SCRIPT_PATH" || return 2
|
||||
|
||||
git fetch origin >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_error "Erreur lors du Fetch"
|
||||
return 3
|
||||
fi
|
||||
git fetch origin >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_error "Erreur lors du Fetch"
|
||||
cd ~
|
||||
return 3
|
||||
fi
|
||||
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
LOCAL=$(git rev-parse HEAD)
|
||||
REMOTE=$(git rev-parse origin/"$BRANCH")
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
LOCAL=$(git rev-parse HEAD)
|
||||
REMOTE=$(git rev-parse origin/"$BRANCH")
|
||||
|
||||
if [ "$LOCAL" = "$REMOTE" ]; then
|
||||
return 0
|
||||
fi
|
||||
if [ "$LOCAL" = "$REMOTE" ]; then
|
||||
cd ~
|
||||
return 0
|
||||
fi
|
||||
|
||||
# update
|
||||
echo ""
|
||||
git reset --hard origin/"$BRANCH"
|
||||
if [ $? -eq 0 ]; then
|
||||
msg_success "Les script de welcome a été mis à jour !! relancer le ssh pour profiter des nouvelles fonctionnalités"
|
||||
# update
|
||||
echo ""
|
||||
return 1
|
||||
else
|
||||
msg_error "Erreur lors de la mise à jour du script"
|
||||
return 4
|
||||
fi
|
||||
git reset --hard origin/"$BRANCH"
|
||||
if [ $? -eq 0 ]; then
|
||||
msg_success "Les script de welcome a été mis à jour !! relancer le ssh pour profiter des nouvelles fonctionnalités"
|
||||
echo ""
|
||||
cd ~
|
||||
return 1
|
||||
else
|
||||
msg_error "Erreur lors de la mise à jour du script"
|
||||
cd ~
|
||||
return 4
|
||||
fi
|
||||
}
|
||||
Loading…
Reference in New Issue