From 0f4f149544156ef74c840926ef0410f948a5e04d Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 10 Oct 2024 10:06:18 +0200 Subject: [PATCH] nb-update PULL=1 --- .githooks/pre-commit | 8 +------- bin/{nb-repo-install => nb-repo-update} | 8 +++++--- bin/nb-update | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) rename bin/{nb-repo-install => nb-repo-update} (92%) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 2831fc94..dd52460b 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,18 +1,12 @@ #!/bin/bash -l -# NB 12.03.19 echo DEBUG: pre-commit $* 1>&2 -# NB 12.03.19 [ -d www/dbq/ ] && (cd www/dbq/ && minify_dir) | while read -r f; do -# NB 12.03.19 echo "Minify $f" -# NB 12.03.19 git add "$f" -# NB 12.03.19 done - echo "Run $0" if which minify > /dev/null; then MINIFY="" [ -z "$MINIFY" ] && minify --help 2>&1 | grep -q '\-\-css ' && MINIFY="ext" [ -z "$MINIFY" ] && minify --help 2>&1 | grep -q '\-\-output ' && MINIFY="out" - [ -z "$MINIFY" ] || git status --porcelain|sed -E 's/^ *(\?\?|[A-Z]) +//' | while read file; do + [ -z "$MINIFY" ] || git diff --name-only | while read file; do ext="" case "$file" in *.min.*) continue ;; diff --git a/bin/nb-repo-install b/bin/nb-repo-update similarity index 92% rename from bin/nb-repo-install rename to bin/nb-repo-update index ddfb918a..669bb280 100755 --- a/bin/nb-repo-install +++ b/bin/nb-repo-update @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################# # -# nb-repo-install +# nb-repo-update # ################################################################################# @@ -88,7 +88,7 @@ done # ################################################################################# exec {F_INDENT1}> >(sed 's/^/ /') -exec {F_INDENT2}> >(sed 's/^/ /') +exec {F_INDENT2}> >(sed -e 's/\r/\n/g' -e 's/^ *//' -e 's/^/ /') trap 'exec {F_INDENT1}>&-; exec {F_INDENT2}>&-;' EXIT if [ "$PULL" = "1" ]; then @@ -114,7 +114,9 @@ git pull >&$F_INDENT1 || exit if [ "$CLEANUP" = "1" ] then echo " >git gc cleanup" - git gc >&$F_INDENT1 || exit + #export GIT_FLUSH=0 + git gc >&$F_INDENT2 2>&1 || exit + #script --return --quiet --flush --log-out /dev/null --command 'git gc' >&$F_INDENT2 2>&1 || exit fi #echo diff --git a/bin/nb-update b/bin/nb-update index 3ffc0f69..3d4809ed 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -37,7 +37,7 @@ Git pull repos DEBUG=0 CLEANUP=0 POST_INFO=1 -PULL=0 +PULL=1 ################################################################################# # # Args @@ -182,7 +182,7 @@ then opt="--pull" [ "$CLEANUP" = "1" ] && opt="$opt --cleanup" opt="${opt# *}" - exec_user $user "nb-repo-install $opt" #>&$F_INDENT 2>&1 + exec_user $user "nb-repo-update $opt" #>&$F_INDENT 2>&1 ex_repo=$? [ "$ex_repo" = "0" ] || ex=$ex_repo #echo $ex_repo -- 2.47.3