This commit is contained in:
陆柯 2021-07-09 17:10:33 +08:00
parent c0be6a1da0
commit d8c7f0095e
5 changed files with 82 additions and 46 deletions

View File

@ -1,17 +1,29 @@
@echo off
@ IF "%1" == "" (if exist D:\faronear (set BASEDIR=D:\faronear) else (set BASEDIR=..\..)) else (set BASEDIR=%1)
echo [ Goto %BASEDIR% as base directory ]
if not exist %BASEDIR% (
echo *** [%BASEDIR%] not exist! Exit now. ***
@ GOTO END
)
pushd %BASEDIR%
echo [ %CD% ]
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
echo *** Current path = [%CD%] ***
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
)
popd
pause
@GOTO END
:EMPTY
@ echo Empty target! Please assign a target path.
@ GOTO END
:END

View File

@ -4,32 +4,37 @@ if [ $1 ]
then
FONPATH=$1
else
read -p "Enter path to git pull (leave blank for default ../..) >> " FONPATH
read -p "Enter faronear path to git pull (leave blank for default ../..) >> " FONPATH
if [ ! $FONPATH ]
then
FONPATH=../..
fi
fi
echo ">> Goto $FONPATH as base directory"
if [ ! -d $FONPATH ]
then
echo "*** [$FONPATH] not exist! Exit now. ***"
exit
fi
pushd $FONPATH
echo ">> `pwd`"
echo "*** Current path = [`pwd`] ***"
for org in `ls .`
do
if [ -d $org ]
then
cd $org;
for repo in `ls .`
do
if [ -d $repo/.git ]
then
echo '>>>>>> git pulling: ' $org/$repo
cd $repo
git pull
cd ..
fi
done
cd ..;
then
cd $org;
for repo in `ls .`
do
if [ -d $repo/.git ]
then
echo "--- git pulling: $org/$repo"
cd $repo
git pull
cd ..
fi
done
cd ..;
fi
done
popd

View File

@ -1,17 +1,17 @@
@echo off
@ IF "%1" == "" (if exist D:\faronear (set BASEDIR=D:\faronear) else (set BASEDIR=..\..)) else (set BASEDIR=%1)
echo [ Goto %BASEDIR% as base directory ]
if not exist %BASEDIR% (
echo *** [%BASEDIR%] not exist! Exit now. ***
@ GOTO END
)
pushd %BASEDIR%
echo [ %CD% ]
echo *** Current path = [%CD%] ***
for /d %%d in (*) do pushd %%d & (for /d %%d in (*) do if exist %%d/package.json (pushd %%d & echo --- npm booting: %%d ... & npm run boot & popd)) & popd
popd
pause
@GOTO END
:EMPTY
@ echo Empty target! Please assign a target path.
@ GOTO END
pause
:END

View File

@ -4,33 +4,37 @@ if [ $1 ]
then
FONPATH=$1
else
read -p "Enter path to npm boot (leave blank for default ../..) >> " FONPATH
read -p "Enter faronear path to npm boot (leave blank for default ../..) >> " FONPATH
if [ ! $FONPATH ]
then
FONPATH=../..
fi
fi
echo ">> Goto $FONPATH as base directory"
if [ ! -d $FONPATH ]
then
echo "*** [$FONPATH] not exist! Exit now. ***"
exit
fi
pushd $FONPATH
echo ">> Current path = `pwd`"
echo "*** Current path = [`pwd`] ***"
for org in `ls .`
do
if [ -d $org ]
then
cd $org;
for repo in `ls .`
do
if [ -f $repo/package.json ]
then
echo '>>>>>> npm booting: ' $org/$repo
cd $repo
npm run boot
cd ..
fi
done
cd ..;
then
cd $org;
for repo in `ls .`
do
if [ -f $repo/package.json ]
then
echo '>>>>>> npm booting: ' $org/$repo
cd $repo
npm run boot
cd ..
fi
done
cd ..;
fi
done
popd

15
press-anykey-to-exit.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo "Press any key to exit!"
char=`get_char`