From fcd08cd98ed6e79429759982a7125b4957f6c966 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Mon, 24 Oct 2022 12:27:25 +0800 Subject: [PATCH] U --- git-pull-all.bat | 2 +- git-pull-recursive.bat | 17 +++++++++-------- git-pull-recursive.sh | 4 ++-- git-push-all.bat | 4 ++-- git-push-recursive.sh | 4 ++-- npm-boot-all.bat | 2 +- npm-boot-recursive.bat | 3 +-- npm-boot-recursive.sh | 9 ++++++--- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/git-pull-all.bat b/git-pull-all.bat index 23841ec..6ad5bca 100644 --- a/git-pull-all.bat +++ b/git-pull-all.bat @@ -37,7 +37,7 @@ for /d %%o in (*) do ( @REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 if not "%%o" == ".vscode" ( @REM 如果同时使用了 GIT 和 云盘进行管理,每次 git pull 都会造成 .git 目录下某些文件变化,导致云盘不断自动同步。因此过滤掉云盘的目录不做更新。 - @REM echo %%o | findstr "=" >NUL && ( + @REM echo "%%o" | findstr "=" >NUL && ( @REM echo !!!!!!!! omitting [%FONPATH%\%%o] !!!!!!!! @REM echo; @REM ) || ( diff --git a/git-pull-recursive.bat b/git-pull-recursive.bat index 02bff0f..0be84e4 100644 --- a/git-pull-recursive.bat +++ b/git-pull-recursive.bat @@ -32,14 +32,15 @@ echo *** Starting from [%CD%] *** echo; for /d /r %%r in (*) do ( - @REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 - if not "%%r" == ".vscode" ( - if exist "%%r\.git" ( - pushd "%%r" - echo ---- git pulling [%FONPATH%\%%r] ---- - git pull --all - echo; - popd + echo "%%r" | findstr "\.git" > NUL || ( + echo "%%r" | findstr "node_modules" >NUL || ( + if exist "%%r\.git" ( + pushd "%%r" + echo ---- git pulling [%%r] ---- + git pull --all + echo; + popd + ) ) ) ) diff --git a/git-pull-recursive.sh b/git-pull-recursive.sh index a4d4171..951857e 100644 --- a/git-pull-recursive.sh +++ b/git-pull-recursive.sh @@ -36,11 +36,11 @@ pushd $FONPATH echo "*** Starting from [`pwd`] ***" echo "" -find . -mindepth 1 -maxdepth 3 -type d -name '?*' | grep -v 'node_modules' | while read repo +find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -v 'node_modules' | while read repo do if [ -d "$repo/.git" ] then - echo "---- git pulling [`pwd`/$repo] ----" + echo "---- git pulling [$repo] ----" pushd "$repo" git pull --all echo "" diff --git a/git-push-all.bat b/git-push-all.bat index 1b83bca..5705f35 100644 --- a/git-push-all.bat +++ b/git-push-all.bat @@ -44,7 +44,7 @@ for /d %%o in (*) do ( @REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 if not "%%o" == ".vscode" ( @REM 如果同时使用了 GIT 和 云盘进行管理,每次 git push 都会造成 .git 目录下某些文件变化,导致云盘不断自动同步。因此过滤掉云盘的目录不做更新。 - @REM echo %%o | findstr "=" >NUL && ( + @REM echo "%%o" | findstr "=" >NUL && ( @REM echo !!!!!!!! omitting [%FONPATH%\%%o] !!!!!!!! @REM echo; @REM ) || ( @@ -54,7 +54,7 @@ for /d %%o in (*) do ( for /d %%g in (*) do ( if exist %%g\.git ( pushd %%g - echo ---- git add-commit-push [%FONPATH%\%%o\%%g] ---- + echo ---- git commit and push [%FONPATH%\%%o\%%g] ---- git add . && git commit -m "%COMMIT_MESSAGE%" && git push echo; popd diff --git a/git-push-recursive.sh b/git-push-recursive.sh index 21697b8..a702333 100644 --- a/git-push-recursive.sh +++ b/git-push-recursive.sh @@ -44,11 +44,11 @@ then fi echo "" -find . -mindepth 1 -maxdepth 3 -type d -name '?*' | grep -v 'node_modules' | while read repo +find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -v 'node_modules' | while read repo do if [ -d "$repo/.git" ] then - echo "---- git commit & push [`pwd`/$repo] ----" + echo "---- git commit & push [$repo] ----" pushd "$repo" git add . && git commit -m "$COMMIT_MESSAGE" && git push echo "" diff --git a/npm-boot-all.bat b/npm-boot-all.bat index 4b83a0f..5ad5a22 100644 --- a/npm-boot-all.bat +++ b/npm-boot-all.bat @@ -35,7 +35,7 @@ echo; for /d %%o in (*) do ( @ if not "%%o" == ".vscode" ( - @REM @ echo %%o | findstr "=" >NUL && ( + @REM @ echo "%%o" | findstr "=" >NUL && ( @REM echo !!!!!!!! omitting [%FONPATH%\%%o] !!!!!!!! @REM echo; @REM ) || ( diff --git a/npm-boot-recursive.bat b/npm-boot-recursive.bat index bdbe441..57f083e 100644 --- a/npm-boot-recursive.bat +++ b/npm-boot-recursive.bat @@ -32,8 +32,7 @@ echo *** Starting from [%CD%] *** echo; for /d /r %%r in (*) do ( - @REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 - if not "%%r" == ".vscode" ( + echo "%%r" | findstr "node_modules" >NUL || ( if exist "%%r\package.json" ( findstr "\"boot\"" "%%r\package.json" >NUL && ( pushd %%r diff --git a/npm-boot-recursive.sh b/npm-boot-recursive.sh index 2456ae4..1870e7f 100644 --- a/npm-boot-recursive.sh +++ b/npm-boot-recursive.sh @@ -36,14 +36,17 @@ pushd $FONPATH echo "*** Starting from [`pwd`] ***" echo "" -find . -mindepth 1 -maxdepth 3 -type d -name '?*' | grep -v 'node_modules' | while read repo +find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -v 'node_modules' | while read repo do if ( [ -f "$repo/package.json" ] && grep -q '"boot"' "$repo/package.json" ) then - echo "---- npm booting: [`pwd`/$repo] ----" + echo "" + echo "---- npm booting: [$repo] ----" + echo "" pushd "$repo" npm run boot - echo "---- npm booted: [`pwd`/$repo] ----" + echo "" + echo "---- npm booted: [$repo] ----" echo "" popd fi