From 47b6e5b359e2eded6a5443de70f68ea25fd289ec Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 8 Sep 2015 10:14:13 +0400 Subject: [PATCH] =?UTF-8?q?cr=C3=A9er=20VERSION.txt=20et=20CHANGES.txt=20?= =?UTF-8?q?=C3=A0=20la=20racine=20du=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prel | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/prel b/prel index 645f995..e446a8d 100755 --- a/prel +++ b/prel @@ -278,6 +278,7 @@ if [ "$action" == checkout ]; then git_ensure_cleancheckout is_any_branch "$release" master release || die "$release: ce n'est pas une branche de release" r=0 + newbranch= if git_have_branch "$release"; then git checkout "$release"; r=$? elif git_have_rbranch "$release"; then @@ -288,6 +289,7 @@ Vous allez créer la nouvelle branche de release ${COULEUR_VERTE}$release${COULE à partir de la branche source ${COULEUR_BLEUE}$source${COULEUR_NORMALE}" ask_yesno "Voulez-vous continuer?" O || die + newbranch=1 git_ensure_branch "$release" "$source" "$origin" [ $? -eq 2 ] && die "Impossible de créer la branche $release. Veuillez vérifier que la branche $source existe" git checkout "$release"; r=$? @@ -298,6 +300,10 @@ Vous allez créer la nouvelle branche de release ${COULEUR_VERTE}$release${COULE fi if [ "$r" -eq 0 -a -n "$write" ]; then + set cwd=pwd + setx workdir=git rev-parse --show-toplevel + [ -d "$workdir" ] && cd "$workdir" + commitmsg="Init changelog" if [ -n "$newver" ]; then pver -uv "$newver" && commitmsg="Init changelog & version $newver" @@ -330,6 +336,8 @@ $modifs" git add -A git commit -m "$commitmsg" + + cd "$cwd" fi fi if [ "$r" -eq 0 ]; then @@ -342,7 +350,7 @@ $modifs" # mettre à jour la branche sur laquelle on se trouve setx branch=git_get_branch action=merge - elif [ "$r" -eq 0 ]; then + elif [ "$r" -eq 0 -a -n "$newbranch" ]; then action=push array_addu push_branches "$release" else