This commit is contained in:
Luk 2024-04-24 14:01:19 +08:00
parent 29f7dd5858
commit e1683a2d0a
4 changed files with 38 additions and 16 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -30,7 +30,10 @@ echo "=== Enter [path to .gitignore.global.txt] or [leave blank] for default [[h
read -p ">>> " IGNOREPATH read -p ">>> " IGNOREPATH
if [ "$IGNOREPATH" ] if [ "$IGNOREPATH" ]
then then
IGNOREPATH=$(realpath $IGNOREPATH)/.gitignore.global.txt if [ -d "$IGNOREPATH" ]
then
IGNOREPATH=$(realpath $IGNOREPATH)/.gitignore.global.txt
fi
if [ ! -f "$IGNOREPATH" ] if [ ! -f "$IGNOREPATH" ]
then then
echo "××× Not found [[$IGNOREPATH]]. Exit now..." echo "××× Not found [[$IGNOREPATH]]. Exit now..."
@ -56,10 +59,16 @@ echo ""
find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules|uni_modules|\.deploy_git|\.git|.svn|\.vscode|\.wrangler|unpackage|_webroot|_logstore|_datasotre|_archive|_filestore|_ssl' | while read repo find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules|uni_modules|\.deploy_git|\.git|.svn|\.vscode|\.wrangler|unpackage|_webroot|_logstore|_datasotre|_archive|_filestore|_ssl' | while read repo
do do
if [ -f "$repo/.gitignore" ] # some git repo need to keep privacy, therefore judge from .gitignore, not from .git if [ -f "$repo/.gitignore.local.txt" ] # some git repo need to keep privacy, therefore judge from .gitignore, not from .git
then then
echo "---- updating .gitignore in [[$repo]] ----" echo "---- updating [[$repo/.gitignore]] ----"
cat $IGNOREPATH $repo/.gitignore.local.txt 2>/dev/null > $repo/.gitignore if [ -f "$IGNOREPATH" ]
then
cat $IGNOREPATH > $repo/.gitignore
else
curl -sSL $IGNOREPATH | cat > $repo/.gitignore
fi
cat $repo/.gitignore.local.txt 2>/dev/null > $repo/.gitignore
echo "" echo ""
fi fi
done done

View File

@ -7,12 +7,17 @@
### .gitignore.global.txt ### ### .gitignore.global.txt ###
# Self defined extension to ignore all files/folders containing .gitignore # Self defined pattern to ignore
*.gitignore.* ?*.gitignore
*.gitignore.*/ ?*.gitignore/
*.gitignore ?*.gitignore.*
*.gitignore/ ?*.gitignore.*/
!.gitignore *.gitomit
*.gitomit/
*.gitomit.*
*.gitomit.*/
# 保留
!.gitkeep
# 通用 # 通用
.svn/ .svn/
@ -23,7 +28,9 @@
/test/unit/coverage/ /test/unit/coverage/
/test/e2e/reports/ /test/e2e/reports/
node_modules/ node_modules/
*.aab
*.apk *.apk
*.ipa
*.min.js *.min.js
*.min.css *.min.css
*.min.html *.min.html
@ -96,8 +103,5 @@ _desktop.ini
package-lock.json package-lock.json
pages4loader.json5 pages4loader.json5
# 保留
!.gitkeep
### .gitignore.local.txt ### ### .gitignore.local.txt ###

View File

@ -30,7 +30,10 @@ echo "=== Enter [path to seafile-ignore.global.txt] or [leave blank] for default
read -p ">>> " IGNOREPATH read -p ">>> " IGNOREPATH
if [ "$IGNOREPATH" ] if [ "$IGNOREPATH" ]
then then
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore.global.txt if [ -d "$IGNOREPATH" ]
then
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore.global.txt
fi
if [ ! -f "$IGNOREPATH" ] if [ ! -f "$IGNOREPATH" ]
then then
echo "××× Not found [[$IGNOREPATH]]. Exit now..." echo "××× Not found [[$IGNOREPATH]]. Exit now..."
@ -58,8 +61,14 @@ find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules|
do do
if [ -f "$repo/seafile-ignore.txt" ] if [ -f "$repo/seafile-ignore.txt" ]
then then
echo "---- updating seafile-ignore.txt in [[$repo]] ----" echo "---- updating [[$repo/seafile-ignore.txt]] ----"
cat $IGNOREPATH $repo/seafile-ignore.local.txt 2>/dev/null > $repo/seafile-ignore.txt if [ -f "$IGNOREPATH" ]
then
cat $IGNOREPATH > $repo/seafile-ignore.txt
else
curl -sSL $IGNOREPATH | cat > $repo/seafile-ignore.txt
fi
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
echo "" echo ""
fi fi
done done