sysconfig/seafile-ignore-tree.sh
2023-10-14 12:27:28 +08:00

49 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ -d "$1" ]
then
FONPATH=$1
else
echo ""
echo "=== Enter [start path] or [leave blank] for default to [[`pwd`]]"
read -p ">>> " FONPATH
echo ""
if [ ! "$FONPATH" ]
then
FONPATH=`pwd`
fi
fi
if [ ! -d "$FONPATH" ]
then
echo "××× [[$FONPATH]] not exist! Exit now. ***"
exit
else
echo "√√√ FONPATH = [[$FONPATH]]"
fi
echo "=== Enter [path-to-seafile-ignore.txt]"
read -p ">>> " SFIGNOREPATH
echo ""
if [ ! -f "$SFIGNOREPATH/seafile-ignore.txt" ]
then
echo "××× Not found [[$SFIGNOREPATH/seafile-ignore.txt]]. Exit now..."
exit
fi
cd $FONPATH
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 unpackage _webroot _logstore _datasotre _archive _filestore _ssl' | while read repo
do
if [ -d "$repo/.git" ]
then
echo "---- updating seafile-ignore.txt in [[$repo]] ----"
cp $SFIGNOREPATH/seafile-ignore.txt $repo/
echo ""
fi
done
cd -