This commit is contained in:
luk
2026-02-01 19:12:37 +08:00
parent dcb621ef20
commit f01868e246
7 changed files with 137 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
echo ""
echo "Search in [ROOTPATH], Merge [IGNOREPATH/seafile-ignore.global.txt] and [ROOTPATH/*/seafile-ignore.local.txt] files to [seafile-ignore.txt]"
echo "Search in [ROOTPATH], Merge [GLOBALPATH/seafile-ignore.global.txt] and [ROOTPATH/*/seafile-ignore.local.txt] files to [seafile-ignore.txt]"
echo ""
if [ -d "$1" ]
@@ -27,22 +27,22 @@ fi
echo ""
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
read -p "***:: " IGNOREPATH
if [ "$IGNOREPATH" ]
read -p "***:: " GLOBALPATH
if [ "$GLOBALPATH" ]
then
if [ -d "$IGNOREPATH" ]
if [ -d "$GLOBALPATH" ]
then
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore.global.txt
GLOBALPATH=$(realpath $GLOBALPATH)/seafile-ignore.global.txt
fi
if [ ! -f "$IGNOREPATH" ]
if [ ! -f "$GLOBALPATH" ]
then
echo "××× Not found [[$IGNOREPATH]]. Exit now..."
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
exit
else
echo "√√√ IGNOREPATH = [[$IGNOREPATH]]"
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
fi
else
IGNOREPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
GLOBALPATH=https://git.tic.cc/npm/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
fi
echo ""
@@ -57,16 +57,16 @@ cd $ROOTPATH
echo "*** Starting from [[`pwd`]] ***"
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 0 -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/seafile-ignore.txt" ]
if [ -f "$repo/seafile-ignore.txt" ] || [ -d "$repo/.git" ]
then
echo "---- updating [[$repo/seafile-ignore.txt]] ----"
if [ -f "$IGNOREPATH" ]
if [ -f "$GLOBALPATH" ]
then
cat $IGNOREPATH > $repo/seafile-ignore.txt
cat $GLOBALPATH > $repo/seafile-ignore.txt
else
curl -sSL $IGNOREPATH | cat > $repo/seafile-ignore.txt
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
fi
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
echo ""