|
|
|
@ -1,14 +1,9 @@ |
|
|
|
#!/bin/env bash
|
|
|
|
|
|
|
|
git_current_branch() {
|
|
|
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
|
|
|
|
}
|
|
|
|
CUR_BRANCH=`git_current_branch`
|
|
|
|
|
|
|
|
CIBLE=$1
|
|
|
|
if [ "$CIBLE" == "" ]
|
|
|
|
then
|
|
|
|
CIBLE=$CUR_BRANCH |
|
|
|
CIBLE=$GIT_CURRENT_BRANCH
|
|
|
|
fi
|
|
|
|
|
|
|
|
internal_delete_branch() {
|
|
|
|
@ -27,7 +22,7 @@ delete_branch() { |
|
|
|
|
|
|
|
git_03_push_branch.sh
|
|
|
|
|
|
|
|
if [ ! "$CUR_BRANCH" = "develop" ] |
|
|
|
if [ ! "$GIT_CURRENT_BRANCH" = "develop" ] |
|
|
|
then
|
|
|
|
echo "La branche actuelle n'est pas develop"
|
|
|
|
read -p "Voulez-vous basculer sur develop ? " -n 1 -r
|
|
|
|
@ -39,7 +34,7 @@ then |
|
|
|
fi
|
|
|
|
|
|
|
|
case $CIBLE in
|
|
|
|
($CUR_BRANCH) echo "Impossible : $CIBLE is current branch !";; |
|
|
|
($GIT_CURRENT_BRANCH) echo "Impossible : $CIBLE is current branch !";; |
|
|
|
("evo"*) delete_branch $CIBLE;;
|
|
|
|
("ano"*) delete_branch $CIBLE;;
|
|
|
|
(*) echo "$CIBLE is not a feature branch";;
|
|
|
|
|