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:
40
git_repo_change_hook_path.sh
Executable file
40
git_repo_change_hook_path.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "in [REPOROOT]/*/*/hooks/[pre-receive.d|post-receive.d|update.d]/gitea, path is hard-coded in full such as `/faronear/git/gitea/gitea hook --config=/faronear/git/gitea/custom/conf/app.ini`, you need to replace it if the path is changed."
|
||||
echo "[20230305] noticed that gitea 1.18.5 default is `/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini`"
|
||||
|
||||
echo "::*** Enter [old hook path string] or [leave blank] for default '/faronear/git/gitea/gitea':"
|
||||
read -p "***:: " OLDPATH
|
||||
if [ ! "$OLDPATH"]
|
||||
then
|
||||
OLDPATH=/faronear/git/gitea/gitea
|
||||
fi
|
||||
|
||||
echo "::*** Enter [new hook path string] or [leave blank] for default '/usr/local/bin/gitea': "
|
||||
read -p "***:: " NEWPATH
|
||||
if [ ! "$NEWPATH" ]
|
||||
then
|
||||
NEWPATH=/usr/local/bin/gitea
|
||||
fi
|
||||
|
||||
echo "::*** Enter [root path] of repositories, or [leave blank] for default [[]]`pwd`]] "
|
||||
read -p "***:: " REPOROOT
|
||||
if [ "$ROOTPATH"]
|
||||
then
|
||||
ROOTPATH=`realpath $ROOTPATH`
|
||||
else
|
||||
ROOTPATH=`pwd`
|
||||
fi
|
||||
|
||||
echo "::*** Enter [y] to start updating, or [anything else] to quit"
|
||||
read -p "***:: " YESNO
|
||||
if [ "$YESNO" != 'y' ]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# 用 : 来取代 /,以避免大量出现 \/
|
||||
# sed -i "s/\/home\/fon\//\/root\//g" `grep '/home/fon' -rl git.repo/*/*/hooks/*.d/gitea`
|
||||
sed -i "s:$OLDPATH:$NEWPATH:g" `grep "$OLDPATH" -rl $REPOROOT/*/*/hooks/*.d/gitea`
|
||||
|
||||
echo "Completed replacing $OLDPATH to $NEWPATH recursively in folder $REPOROOT"
|
||||
Reference in New Issue
Block a user