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

48
git-ignore-find2copy.sh Normal file
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 .gitignore]"
read -p ">>> " IGNOREPATH
echo ""
if [ ! -f "$IGNOREPATH/.gitignore" ]
then
echo "××× Not found [[$IGNOREPATH/.gitignore]]. 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 [ -d "$repo/.git" ]
then
echo "---- updating .gitignore in [[$repo]] ----"
cp $IGNOREPATH/.gitignore $repo/
echo ""
fi
done
cd -