过滤掉 @cloud 结尾的目录不做 git pull 和 npm run boot

This commit is contained in:
陆柯 2021-08-18 10:45:39 +08:00
parent 1ea14cee5f
commit 6ce99af4a9
4 changed files with 33 additions and 20 deletions

View File

@ -25,18 +25,25 @@ echo *** Current path = [%CD%] ***
@REM for /d %%d in (*) do ( pushd %%d & ( for /d %%d in (*) do ( if exist %%d/.git pushd %%d & echo --- git pulling: %%d ... & git pull & popd ) ) & popd ) @REM for /d %%d in (*) do ( pushd %%d & ( for /d %%d in (*) do ( if exist %%d/.git pushd %%d & echo --- git pulling: %%d ... & git pull & popd ) ) & popd )
for /d %%o in (*) do ( for /d %%o in (*) do (
@REM windows的链接文件会造成路径错误从而终止该循环从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。
if not %%o == .vscode ( if not %%o == .vscode (
@REM 每次 git pull 都会造成 .git 目录下某些文件变化,导致云端不断自动同步。因此过滤掉 *@cloud 的目录不做更新。
echo %%o | findstr "@cloud" && (
echo omitting [%BASEDIR%\%%o]
) || (
echo entering [%BASEDIR%\%%o]
pushd %%o pushd %%o
for /d %%g in (*) do ( for /d %%g in (*) do (
if exist %%g/.git ( if exist %%g/.git (
pushd %%g pushd %%g
echo --- git pulling: %%g ... echo git pulling [%BASEDIR%\%%o\%%g]
git pull git pull
popd popd
) )
) )
popd popd
) )
)
) )
popd popd

View File

@ -30,16 +30,17 @@ fi
pushd $FONPATH pushd $FONPATH
echo "*** Current path = [`pwd`] ***" echo "*** Current path = [`pwd`] ***"
for org in `ls .` for org in `ls | grep -v @cloud`
do do
if [ -d $org ] if [ -d $org ]
then then
echo " entering [$FONPATH/$org]"
cd $org; cd $org;
for repo in `ls .` for repo in `ls .`
do do
if [ -d $repo/.git ] if [ -d $repo/.git ]
then then
echo "--- git pulling: $org/$repo" echo " git pulling [$FONPATH/$org/$repo]"
cd $repo cd $repo
git pull git pull
cd .. cd ..

View File

@ -26,17 +26,22 @@ echo *** Current path = [%CD%] ***
for /d %%o in (*) do ( for /d %%o in (*) do (
if not %%o == .vscode ( if not %%o == .vscode (
echo %%o | findstr "@cloud" && (
echo omitting [%BASEDIR%\%%o]
) || (
echo entering [%BASEDIR%\%%o]
pushd %%o pushd %%o
for /d %%g in (*) do ( for /d %%g in (*) do (
if exist %%g/package.json ( if exist %%g/package.json (
pushd %%g pushd %%g
echo --- npm booting: %%g ... echo npm booting [%BASEDIR%\%%o\%%g]
npm run boot npm run boot
popd popd
) )
) )
popd popd
) )
)
) )
popd popd

View File

@ -30,7 +30,7 @@ fi
pushd $FONPATH pushd $FONPATH
echo "*** Current path = [`pwd`] ***" echo "*** Current path = [`pwd`] ***"
for org in `ls .` for org in `ls | grep -v @cloud`
do do
if [ -d $org ] if [ -d $org ]
then then