]> git.nbdom.net Git - nb.git/commitdiff
gitf_publish
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 May 2023 20:38:40 +0000 (22:38 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 May 2023 20:38:40 +0000 (22:38 +0200)
etc/profile.d/git.sh

index e1b6a52b6ba800180568ae791cc87f18d65173dc..ef1379203c5887a3c08819827b06d8298f1bd315 100644 (file)
@@ -66,13 +66,14 @@ EOF
        shift
        declare file="${1:?Args 1: file is missing}"
 
+       declare fmt='>>\n>> %s\n>>\n'
        #
        # Commit
        #
        declare comment
        if [ -n "$(git status --porcelain "$file")" ]
        then
-               echo -e ">> COMMIT\n"
+               printf "$fmt" "COMMIT"
                declare default="${file##$(git_root)/}"
                read -e -p "Your comment: " -i "$default" comment
                if [ -z "$comment" ]
@@ -87,7 +88,7 @@ EOF
        #
        # Push
        #
-       echo -e ">> PUSH\n"
+       printf "$fmt" "PUSH"
        git push
 
        #
@@ -97,11 +98,11 @@ EOF
        then
                case "$(git_branch)" in
                        master)
-                               echo -e ">> MERGE TO testing\n"
+                               printf "$fmt" "MERGE TO testing"
                                git branch | grep ' testing$' && git_merge_to testing
                        ;;
                        testing)
-                               echo -e ">> MERGE TO master\n"
+                               printf "$fmt" "MERGE TO master"
                                git_merge_to master
                        ;;
                esac