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 @echo off
@ IF "%1" == "" (if exist D:\faronear (set BASEDIR=D:\faronear) else (set BASEDIR=..\..)) else (set BASEDIR=%1) @ 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% pushd %BASEDIR%
echo [ %CD% ] 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 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 popd
pause pause
@GOTO END @GOTO END
:EMPTY
@ echo Empty target! Please assign a target path.
@ GOTO END
:END :END

View File

@ -4,16 +4,21 @@ if [ $1 ]
then then
FONPATH=$1 FONPATH=$1
else 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 ] if [ ! $FONPATH ]
then then
FONPATH=../.. FONPATH=../..
fi fi
fi fi
echo ">> Goto $FONPATH as base directory"
if [ ! -d $FONPATH ]
then
echo "*** [$FONPATH] not exist! Exit now. ***"
exit
fi
pushd $FONPATH pushd $FONPATH
echo ">> `pwd`" echo "*** Current path = [`pwd`] ***"
for org in `ls .` for org in `ls .`
do do
if [ -d $org ] if [ -d $org ]
@ -23,7 +28,7 @@ do
do do
if [ -d $repo/.git ] if [ -d $repo/.git ]
then then
echo '>>>>>> git pulling: ' $org/$repo echo "--- git pulling: $org/$repo"
cd $repo cd $repo
git pull git pull
cd .. cd ..

View File

@ -1,17 +1,17 @@
@echo off @echo off
@ IF "%1" == "" (if exist D:\faronear (set BASEDIR=D:\faronear) else (set BASEDIR=..\..)) else (set BASEDIR=%1) @ 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% 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 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 popd
pause
@GOTO END
:EMPTY pause
@ echo Empty target! Please assign a target path.
@ GOTO END
:END :END

View File

@ -4,17 +4,21 @@ if [ $1 ]
then then
FONPATH=$1 FONPATH=$1
else 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 ] if [ ! $FONPATH ]
then then
FONPATH=../.. FONPATH=../..
fi fi
fi fi
echo ">> Goto $FONPATH as base directory" if [ ! -d $FONPATH ]
then
echo "*** [$FONPATH] not exist! Exit now. ***"
exit
fi
pushd $FONPATH pushd $FONPATH
echo ">> Current path = `pwd`" echo "*** Current path = [`pwd`] ***"
for org in `ls .` for org in `ls .`
do do
if [ -d $org ] if [ -d $org ]

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`