diff --git a/wip/pman b/wip/pman index c81e5a2..2e08fa2 100755 --- a/wip/pman +++ b/wip/pman @@ -33,34 +33,34 @@ function show_action() { ################################################################################ function _push_branches() { + [ ${#push_branches[*]} -gt 0 ] || return [ -n "$Origin" ] || Origin=origin - git_have_remote "$Origin" || retun - if [ ${#push_branches[*]} -gt 0 ]; then - local -a cmds remote rbranch - for branch in "${push_branches[@]}"; do - setx remote=git_get_branch_remote "$branch" - if [ "$remote" == "$Origin" ]; then - setx rbranch=git_get_branch_merge "$branch" - if [ -n "$rbranch" ]; then - cmds+=("$(qvals git push "$Origin" "$branch:$rbranch")") - else - cmds+=("$(qvals git push -u "$Origin" "$branch:$branch")") - fi + git_have_remote "$Origin" || return + + local -a cmds remote rbranch + for branch in "${push_branches[@]}"; do + setx remote=git_get_branch_remote "$branch" + if [ "$remote" == "$Origin" ]; then + setx rbranch=git_get_branch_merge "$branch" + if [ -n "$rbranch" ]; then + cmds+=("$(qvals git push "$Origin" "$branch:$rbranch")") else cmds+=("$(qvals git push -u "$Origin" "$branch:$branch")") fi - done - [ -n "$Push" ] || enote "L'option --no-push étant utilisée, les opérations à effectuer sont simplement affichées" - for cmd in "${cmds[@]}"; do - einfo "$cmd" - if [ -n "$Push" ]; then - if ! eval "$cmd"; then - ewarn "Une erreur s'est produite, les opérations seront simplement affichées" - Push= - fi + else + cmds+=("$(qvals git push -u "$Origin" "$branch:$branch")") + fi + done + [ -n "$Push" ] || enote "L'option --no-push étant utilisée, les opérations à effectuer sont simplement affichées" + for cmd in "${cmds[@]}"; do + einfo "$cmd" + if [ -n "$Push" ]; then + if ! eval "$cmd"; then + ewarn "Une erreur s'est produite, les opérations seront simplement affichées" + Push= fi - done - fi + fi + done } function init_repo_action() { @@ -159,8 +159,9 @@ function init_dist_action() { } function init_feature_action() { - local branch="$FEATURE${1#$FEATURE}" + local branch="${1#$FEATURE}" [ -n "$branch" ] || die "Vous devez définir la nom de la branche à créer" + branch="$FEATURE$branch" if ! array_contains AllBranches "$branch"; then [ -n "$DEVELOP" ] || die "La branche DEVELOP n'a pas été définie"