refactor: 脚本及配置文件命名统一用 _ 分隔
将 .sh/.bat 脚本与 .js/.plist/.Dockerfile 等文件中以 - 分隔的文件名 改为 _ 分隔,dcloud-renew 目录改为 dcloud、script_nuance 目录改为 nuance,并同步更新脚本内部引用与 README 路径。 Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This commit is contained in:
80
seafile_ignore_find2merge.sh
Executable file
80
seafile_ignore_find2merge.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo ""
|
||||
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" ]
|
||||
then
|
||||
ROOTPATH=$1
|
||||
else
|
||||
echo "::*** Enter [root path] or [leave blank] for default [[`pwd`]] to start tree search for seafile-ignore.txt files"
|
||||
read -p "***:: " ROOTPATH
|
||||
if [ "$ROOTPATH" ]
|
||||
then
|
||||
ROOTPATH=$(realpath "${ROOTPATH/#\~/$HOME}")
|
||||
else
|
||||
ROOTPATH=`pwd`
|
||||
fi
|
||||
fi
|
||||
if [ ! -d "$ROOTPATH" ]
|
||||
then
|
||||
echo "××× [[$ROOTPATH]] not exist! Exit now. ***"
|
||||
exit
|
||||
else
|
||||
echo "√√√ ROOTPATH = [[$ROOTPATH]]"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
|
||||
read -p "***:: " GLOBALPATH
|
||||
if [ "$GLOBALPATH" ]
|
||||
then
|
||||
GLOBALPATH=$(realpath "${GLOBALPATH/#\~/$HOME}")
|
||||
echo $GLOBALPATH
|
||||
if [ -d "$GLOBALPATH" ]
|
||||
then
|
||||
GLOBALPATH="$GLOBALPATH/seafile-ignore.global.txt"
|
||||
fi
|
||||
if [ -f "$GLOBALPATH" ]
|
||||
then
|
||||
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
|
||||
else
|
||||
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
|
||||
exit
|
||||
fi
|
||||
else
|
||||
GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "::*** Enter [y] to start updating, or [anything else] for dry-run"
|
||||
read -p "***:: " YESNO
|
||||
|
||||
cd $ROOTPATH
|
||||
echo "*** Starting from [[`pwd`]] ***"
|
||||
echo ""
|
||||
|
||||
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" ] || [ -d "$repo/.git" ]
|
||||
then
|
||||
echo "---- updating [[$repo/seafile-ignore.txt]] ----"
|
||||
if [ "$YESNO" = 'y' ]
|
||||
then
|
||||
if [ -f "$GLOBALPATH" ]
|
||||
then
|
||||
cat $GLOBALPATH > $repo/seafile-ignore.txt
|
||||
else
|
||||
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
|
||||
fi
|
||||
if [ -f "$repo/seafile-ignore.local.txt" ]
|
||||
then
|
||||
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
cd -
|
||||
Reference in New Issue
Block a user