From 7d3837969845c50b0629c2267e5f77bcba30f709 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Wed, 30 Jun 2021 09:37:38 +0800 Subject: [PATCH] u --- git-pull-all.bat | 2 +- git-pull-all.sh | 4 ++-- npm-boot-all.bat | 2 +- npm-boot-all.sh | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 npm-boot-all.sh diff --git a/git-pull-all.bat b/git-pull-all.bat index 6664c23..fd4887d 100644 --- a/git-pull-all.bat +++ b/git-pull-all.bat @@ -3,7 +3,7 @@ @ IF "%1" == "" echo Using current folder as root folder pushd %1 -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 pause @GOTO END diff --git a/git-pull-all.sh b/git-pull-all.sh index 544b1a0..3f998a1 100755 --- a/git-pull-all.sh +++ b/git-pull-all.sh @@ -4,7 +4,7 @@ if [ $1 ] then FONPATH=$1 else - read -p "Enter path to pull (leave blank for default ./) >> " FONPATH + read -p "Enter path to git pull (leave blank for default ./) >> " FONPATH if [ ! $FONPATH ] then echo Use default path: ./ @@ -22,7 +22,7 @@ do do if [ -d $repo/.git ] then - echo '>>>>>> git pull' $org/$repo + echo '>>>>>> git pulling: ' $org/$repo cd $repo git pull cd .. diff --git a/npm-boot-all.bat b/npm-boot-all.bat index 5c392dd..13f3a44 100644 --- a/npm-boot-all.bat +++ b/npm-boot-all.bat @@ -3,7 +3,7 @@ @ IF "%1" == "" echo Using current folder as root folder pushd %1 -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 pause @GOTO END diff --git a/npm-boot-all.sh b/npm-boot-all.sh new file mode 100644 index 0000000..e2d0698 --- /dev/null +++ b/npm-boot-all.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ $1 ] +then + FONPATH=$1 +else + read -p "Enter path to npm boot (leave blank for default ./) >> " FONPATH + if [ ! $FONPATH ] + then + echo Use default path: ./ + FONPATH=./ + fi +fi + +pushd $FONPATH +for org in `ls .` +do + if [ -d $org ] + then + cd $org; + for repo in `ls .` + do + if [ -d $repo/package.json ] + then + echo '>>>>>> npm booting: ' $org/$repo + cd $repo + npm run boot + cd .. + fi + done + cd ..; + fi +done +popd \ No newline at end of file