From 20aae37be515a60d4d2d92b167378dc7ff9729eb Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Mon, 5 Dec 2022 16:38:05 +0800 Subject: [PATCH] u --- debian-config.Dockerfile | 7 +++++++ debian-config.sh | 10 +++++++--- git-pull-all.bat | 24 +++++++++++++----------- git-pull-recursive.bat | 3 ++- git-pull-recursive.sh | 2 +- git-push-all.bat | 24 +++++++++++++----------- git-push-recursive.bat | 3 ++- git-push-recursive.sh | 2 +- npm-boot-recursive.bat | 3 ++- npm-boot-recursive.sh | 2 +- npm-clear-all.bat | 2 +- npm-clear-recursive.bat | 3 ++- 12 files changed, 52 insertions(+), 33 deletions(-) create mode 100644 debian-config.Dockerfile diff --git a/debian-config.Dockerfile b/debian-config.Dockerfile new file mode 100644 index 0000000..849e7e5 --- /dev/null +++ b/debian-config.Dockerfile @@ -0,0 +1,7 @@ +FROM debian:11.5 +LABEL org.opencontainers.image.authors="luk" + +RUN apt update && apt install curl -y +RUN curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-config.sh > ~/debian-config.sh && echo -e "l\n\n\n\n\n" | bash ~/debian-config.sh + +CMD bash diff --git a/debian-config.sh b/debian-config.sh index f7e0a5b..6e982bb 100755 --- a/debian-config.sh +++ b/debian-config.sh @@ -2,7 +2,7 @@ echo "Usage: this.sh [NewUser]" echo "Example: this.sh alice" -echo "curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-config.sh > ~/debian-config.sh && sudo bash ~/debian-config.sh" +echo "curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-config.sh > ~/debian-config.sh && bash ~/debian-config.sh" if [ "$1" ] then @@ -95,8 +95,12 @@ then fi echo -echo "=== Add a new user [$NewUser]" -source /faronear/fon/sysconfig/debian-add-user.sh $NewUser +echo "=== Add a new user [$NewUser]? for yes, for no change:" +read -p ">>> " AddNewUser +if [ "$AddNewUser" == 'y' ] +then + source /faronear/fon/sysconfig/debian-add-user.sh $NewUser +fi echo echo "=== Enable xfce autologin [/etc/lightdm/lightdm.conf]: for autologin as [$NewUser] or for no change:" diff --git a/git-pull-all.bat b/git-pull-all.bat index d0a4735..ecdf9b8 100644 --- a/git-pull-all.bat +++ b/git-pull-all.bat @@ -34,19 +34,21 @@ echo; @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 ( - echo ======== entering [%FONPATH%\%%o] ======== - echo; - pushd %%o - for /d %%g in (*) do ( - if exist "%%g\.git" ( - pushd %%g - echo ---- git pulling [%FONPATH%\%%o\%%g] ---- - git pull --all - echo; - popd + @ if not "%%o" == ".vscode" ( + echo ======== entering [%FONPATH%\%%o] ======== + echo; + pushd %%o + for /d %%g in (*) do ( + if exist "%%g\.git" ( + pushd %%g + echo ---- git pulling [%FONPATH%\%%o\%%g] ---- + git pull --all + echo; + popd + ) ) + popd ) - popd ) popd diff --git a/git-pull-recursive.bat b/git-pull-recursive.bat index 9446aaa..92c3bed 100644 --- a/git-pull-recursive.bat +++ b/git-pull-recursive.bat @@ -32,7 +32,8 @@ echo *** Starting from [%CD%] *** echo; for /d /r %%r in (*) do ( - echo "%%r" | findstr "node_modules" >NUL || ( + @REM @ if not "%%r" == ".vscode" ( + echo "%%r" | findstr "node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl" >NUL || ( if exist "%%r\.git" ( pushd "%%r" echo ---- git pulling [%%r] ---- diff --git a/git-pull-recursive.sh b/git-pull-recursive.sh index 951857e..ee7ad9e 100644 --- a/git-pull-recursive.sh +++ b/git-pull-recursive.sh @@ -36,7 +36,7 @@ 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 -E -v 'node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl' | while read repo do if [ -d "$repo/.git" ] then diff --git a/git-push-all.bat b/git-push-all.bat index 82a7043..7ddb0fb 100644 --- a/git-push-all.bat +++ b/git-push-all.bat @@ -41,19 +41,21 @@ echo; @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 ( - echo ======== entering [%FONPATH%\%%o] ======== - echo; - pushd "%%o" - for /d %%g in (*) do ( - if exist %%g\.git ( - pushd "%%g" - echo ---- git commit and push [%FONPATH%\%%o\%%g] ---- - git add . && git commit -m "%COMMIT_MESSAGE%" && git push - echo; - popd + @ if not "%%o" == ".vscode" ( + echo ======== entering [%FONPATH%\%%o] ======== + echo; + pushd "%%o" + for /d %%g in (*) do ( + if exist %%g\.git ( + pushd "%%g" + echo ---- git commit and push [%FONPATH%\%%o\%%g] ---- + git add . && git commit -m "%COMMIT_MESSAGE%" && git push + echo; + popd + ) ) + popd ) - popd ) popd diff --git a/git-push-recursive.bat b/git-push-recursive.bat index b1e34b7..555b071 100644 --- a/git-push-recursive.bat +++ b/git-push-recursive.bat @@ -39,7 +39,8 @@ set /p COMMIT_MESSAGE=">>> " echo; for /d /r %%r in (*) do ( - echo "%%r" | findstr "node_modules" >NUL || ( + @REM @ if not "%%r" == ".vscode" ( + echo "%%r" | findstr "node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl" >NUL || ( if exist "%%r\.git" ( pushd "%%r" echo ---- git commit and push [%%r] ---- diff --git a/git-push-recursive.sh b/git-push-recursive.sh index a702333..5966ce0 100644 --- a/git-push-recursive.sh +++ b/git-push-recursive.sh @@ -44,7 +44,7 @@ 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 -E -v 'node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl' | while read repo do if [ -d "$repo/.git" ] then diff --git a/npm-boot-recursive.bat b/npm-boot-recursive.bat index 57f083e..d0a35cc 100644 --- a/npm-boot-recursive.bat +++ b/npm-boot-recursive.bat @@ -32,7 +32,8 @@ echo *** Starting from [%CD%] *** echo; for /d /r %%r in (*) do ( - echo "%%r" | findstr "node_modules" >NUL || ( + @REM @ if not "%%r" == "node_modules" ( + echo "%%r" | findstr "node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl" >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 1870e7f..011dfac 100644 --- a/npm-boot-recursive.sh +++ b/npm-boot-recursive.sh @@ -36,7 +36,7 @@ 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 -E -v 'node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl' | while read repo do if ( [ -f "$repo/package.json" ] && grep -q '"boot"' "$repo/package.json" ) then diff --git a/npm-clear-all.bat b/npm-clear-all.bat index f1b7b27..25ed871 100644 --- a/npm-clear-all.bat +++ b/npm-clear-all.bat @@ -34,7 +34,7 @@ echo; @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 ( -@REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 + @REM windows的链接文件会造成路径错误,从而终止该循环,从而导致下一轮乃至所有循环的工作目录错误。因此要过滤掉 .vscode 这个符号链接目录。 @ if not "%%o" == ".vscode" ( echo ======== entering [%FONPATH%\%%o] ======== echo; diff --git a/npm-clear-recursive.bat b/npm-clear-recursive.bat index 5cc65fc..ac7d8db 100644 --- a/npm-clear-recursive.bat +++ b/npm-clear-recursive.bat @@ -32,7 +32,8 @@ echo *** Starting from [%CD%] *** echo; for /d /r %%r in (*) do ( - if not "%%r" == "node_modules" ( + @REM if not "%%r" == "node_modules" ( + echo "%%r" | findstr "node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl" >NUL || ( if exist "%%r\node_modules" ( pushd "%%r" echo ---- Deleting [%FONPATH%\%%r] ----