rename FONPATH to ROOTPATH; add git-ignore-find2copy.sh

This commit is contained in:
Luk
2024-01-28 09:50:54 +08:00
parent d016571ff5
commit 304d2564fa
18 changed files with 380 additions and 329 deletions

View File

@@ -0,0 +1,48 @@
#!/bin/bash
if [ -d "$1" ]
then
ROOTPATH=$1
else
echo ""
echo "=== Enter [start path] or [leave blank] for default to [[`pwd`]]"
read -p ">>> " ROOTPATH
echo ""
if [ ! "$ROOTPATH" ]
then
ROOTPATH=`pwd`
fi
fi
if [ ! -d "$ROOTPATH" ]
then
echo "××× [[$ROOTPATH]] not exist! Exit now. ***"
exit
else
echo "√√√ ROOTPATH = [[$ROOTPATH]]"
fi
echo "=== Enter [path to seafile-ignore.txt]"
read -p ">>> " IGNOREPATH
echo ""
if [ ! -f "$IGNOREPATH/seafile-ignore.txt" ]
then
echo "××× Not found [[$IGNOREPATH/seafile-ignore.txt]]. Exit now..."
exit
fi
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
do
if [ -f "$repo/seafile-ignore.txt" ]
then
echo "---- updating seafile-ignore.txt in [[$repo]] ----"
cp $IGNOREPATH/seafile-ignore.txt $repo/
echo ""
fi
done
cd -