From 2bc8b3c57ea091df89c43baa289e6df50d705c0f Mon Sep 17 00:00:00 2001 From: Luk Date: Wed, 24 Apr 2024 14:16:11 +0800 Subject: [PATCH] improve gitignore and seafile-ignore --- find-and-run-recursively.sh | 2 +- git-ignore-find2merge.sh | 4 ++-- nixhome/.gitignore.global.txt | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/find-and-run-recursively.sh b/find-and-run-recursively.sh index 9040094..1da6a65 100644 --- a/find-and-run-recursively.sh +++ b/find-and-run-recursively.sh @@ -2,7 +2,7 @@ echo "***************************************" echo "find \$FOLDER -mindepth \$MINDEPTH -maxdepth \$MAXDEPTH -type d_f_l -name \"\$PATTERN\" | while read item; do echo \"\$item\"; done" echo "***************************************" -echo "To find in which path? Enter [root path] or [leave blank] for the current path:" +echo "To find in which path? Enter [root path] or [leave blank] for the current path [[`pwd`]]:" read -p ">>> " FIND_FOLDER if [ ! "$FIND_FOLDER" ] then diff --git a/git-ignore-find2merge.sh b/git-ignore-find2merge.sh index dcd5963..3cb030f 100644 --- a/git-ignore-find2merge.sh +++ b/git-ignore-find2merge.sh @@ -59,7 +59,7 @@ 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 do - if [ -f "$repo/.gitignore.local.txt" ] # some git repo need to keep privacy, therefore judge from .gitignore, not from .git + if [ -f "$repo/.gitignore" ] # some git repo need to keep privacy, therefore judge from .gitignore, not from .git then echo "---- updating [[$repo/.gitignore]] ----" if [ -f "$IGNOREPATH" ] @@ -68,7 +68,7 @@ do else curl -sSL $IGNOREPATH | cat > $repo/.gitignore fi - cat $repo/.gitignore.local.txt 2>/dev/null > $repo/.gitignore + cat $repo/.gitignore.local.txt 2>/dev/null >> $repo/.gitignore echo "" fi done diff --git a/nixhome/.gitignore.global.txt b/nixhome/.gitignore.global.txt index b62fb6a..36e9cc0 100644 --- a/nixhome/.gitignore.global.txt +++ b/nixhome/.gitignore.global.txt @@ -17,6 +17,8 @@ *.gitomit.* *.gitomit.*/ # 保留 +!.gitignore +!.gitignore.* !.gitkeep # 通用