u
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo ""
|
||||
echo "Search in [ROOTPATH], Merge [IGNOREPATH/seafile-ignore_global] and [ROOTPATH/*/seafile-ignore_local] files to [seafile-ignore.txt]"
|
||||
echo ""
|
||||
|
||||
if [ -d "$1" ]
|
||||
then
|
||||
ROOTPATH=$1
|
||||
else
|
||||
echo ""
|
||||
echo "=== Enter [start path] or [leave blank] for default to [[`pwd`]]"
|
||||
echo "=== Enter [root path] or [leave blank] for default [[`pwd`]] to start tree search for seafile-ignore.txt files"
|
||||
read -p ">>> " ROOTPATH
|
||||
echo ""
|
||||
if [ ! "$ROOTPATH" ]
|
||||
if [ "$ROOTPATH" ]
|
||||
then
|
||||
ROOTPATH=$(realpath $ROOTPATH)
|
||||
else
|
||||
ROOTPATH=`pwd`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "$ROOTPATH" ]
|
||||
then
|
||||
echo "××× [[$ROOTPATH]] not exist! Exit now. ***"
|
||||
@@ -21,13 +24,28 @@ then
|
||||
else
|
||||
echo "√√√ ROOTPATH = [[$ROOTPATH]]"
|
||||
fi
|
||||
|
||||
echo "=== Enter [path to seafile-ignore.txt]"
|
||||
read -p ">>> " IGNOREPATH
|
||||
echo ""
|
||||
if [ ! -f "$IGNOREPATH/seafile-ignore.txt" ]
|
||||
|
||||
echo "=== Enter [path to seafile-ignore_global] or [leave blank] for default [[`pwd`]]"
|
||||
read -p ">>> " IGNOREPATH
|
||||
if [ "$IGNOREPATH" ]
|
||||
then
|
||||
IGNOREPATH=$(realpath $IGNOREPATH)/seafile-ignore_global
|
||||
else
|
||||
IGNOREPATH=`pwd`/seafile-ignore_global
|
||||
fi
|
||||
if [ ! -f "$IGNOREPATH" ]
|
||||
then
|
||||
echo "××× Not found [[$IGNOREPATH]]. Exit now..."
|
||||
exit
|
||||
else
|
||||
echo "√√√ IGNOREPATH = [[$IGNOREPATH]]"
|
||||
fi
|
||||
|
||||
echo "=== Enter [y] to start updating, or [anything else] to quit"
|
||||
read -p ">>> " YESNO
|
||||
if [ "$YESNO" != 'y' ]
|
||||
then
|
||||
echo "××× Not found [[$IGNOREPATH/seafile-ignore.txt]]. Exit now..."
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -40,7 +58,7 @@ do
|
||||
if [ -f "$repo/seafile-ignore.txt" ]
|
||||
then
|
||||
echo "---- updating seafile-ignore.txt in [[$repo]] ----"
|
||||
cp $IGNOREPATH/seafile-ignore.txt $repo/
|
||||
cat $IGNOREPATH $repo/seafile-ignore_local 2>/dev/null > $repo/seafile-ignore.txt
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user