sysconfig/seafile-ignore-tree.sh
2023-09-26 14:25:25 +08:00

49 lines
1004 B
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 <fonpath> or leave <blank> for default to '.'"
read -p ">>> " FONPATH
echo ""
if [ ! "$FONPATH" ]
then
FONPATH=.
fi
fi
if [ ! -d "$FONPATH" ]
then
echo "××× <$FONPATH> not exist! Exit now. ***"
exit
else
echo "√√√ FONPATH = $FONPATH"
fi
cd $FONPATH
echo "*** Starting from [`pwd`] ***"
echo ""
echo "=== Enter [path-to-seafile-ignore.txt]"
read -p ">>> " SFIGNOREPATH
echo ""
if [ ! -f "$SFIGNOREPATH/seafile-ignore.txt" ]
then
echo "××× Not existed [$SFIGNOREPATH/seafile-ignore.txt]. Exit now..."
exit
fi
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 -