]> danix's work - bash-notes.git/commitdiff
if PLAIN option is enabled, git pull doesn't emit output.
authordanix <redacted>
Tue, 18 Apr 2023 07:11:37 +0000 (09:11 +0200)
committerdanix <redacted>
Tue, 18 Apr 2023 07:11:37 +0000 (09:11 +0200)
SOURCE/CORE/git.sh
notes.sh

index ff674dfad970de49587cfb2cdd6640909423f03b..3ddec6c003ff9861a8c0c1338b4c24bc3ecb710d 100644 (file)
@@ -26,7 +26,7 @@ gitsync() {
             $JQ --arg n "$NOWSYNC" '.git["lastpull"] = $n' "$DB" > $TMPDB
             mv $TMPDB $DB
             cd $BASEDIR
-            $GIT pull
+            [ $PLAIN == false ] && $GIT pull || $GIT pull -q
         else
             # LASTSYNC is the last time we synced to the remote, or 0 if it's the first time.
             LASTSYNC=$($JQ -r '.git["lastpull"] // 0' "$DB")
@@ -36,7 +36,7 @@ gitsync() {
                 $JQ --arg n "$NOWSYNC" '.git["lastpull"] = $n' "$DB" > $TMPDB
                 mv $TMPDB $DB
                 cd $BASEDIR
-                $GIT pull
+                [ $PLAIN == false ] && $GIT pull || $GIT pull -q
             else
                 # Last synced less than $GITSYNCDELAY seconds ago. We shall wait
                 [ $PLAIN == false ] && echo "Last synced less than $GITSYNCDELAY seconds ago. We shall wait"
index 687fefe53a2465ff2f3be401964fe82854b068a4..089daca5b49751263130f1bc41cb152e53204cc5 100755 (executable)
--- a/notes.sh
+++ b/notes.sh
@@ -268,7 +268,7 @@ gitsync() {
             $JQ --arg n "$NOWSYNC" '.git["lastpull"] = $n' "$DB" > $TMPDB
             mv $TMPDB $DB
             cd $BASEDIR
-            $GIT pull
+            [ $PLAIN == false ] && $GIT pull || $GIT pull -q
         else
             # LASTSYNC is the last time we synced to the remote, or 0 if it's the first time.
             LASTSYNC=$($JQ -r '.git["lastpull"] // 0' "$DB")
@@ -278,7 +278,7 @@ gitsync() {
                 $JQ --arg n "$NOWSYNC" '.git["lastpull"] = $n' "$DB" > $TMPDB
                 mv $TMPDB $DB
                 cd $BASEDIR
-                $GIT pull
+                [ $PLAIN == false ] && $GIT pull || $GIT pull -q
             else
                 # Last synced less than $GITSYNCDELAY seconds ago. We shall wait
                 [ $PLAIN == false ] && echo "Last synced less than $GITSYNCDELAY seconds ago. We shall wait"