mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
更新bot启动脚本
This commit is contained in:
@@ -252,6 +252,30 @@ update_depend() {
|
||||
cd $dir_current
|
||||
}
|
||||
|
||||
## 克隆脚本,$1:仓库地址,$2:仓库保存路径,$3:分支(可省略)
|
||||
git_clone_scripts() {
|
||||
local url=$1
|
||||
local dir=$2
|
||||
local branch=$3
|
||||
[[ $branch ]] && local cmd="-b $branch "
|
||||
echo -e "开始克隆仓库 $url 到 $dir\n"
|
||||
git clone $cmd $url $dir
|
||||
exit_status=$?
|
||||
}
|
||||
|
||||
## 更新脚本,$1:仓库保存路径
|
||||
git_pull_scripts() {
|
||||
local dir_current=$(pwd)
|
||||
local dir_work=$1
|
||||
cd $dir_work
|
||||
echo -e "开始更新仓库:$dir_work\n"
|
||||
git fetch --all
|
||||
exit_status=$?
|
||||
git reset --hard
|
||||
git pull
|
||||
cd $dir_current
|
||||
}
|
||||
|
||||
## 导入配置文件,检测平台,创建软连接,识别命令,修复配置文件
|
||||
detect_termux
|
||||
detect_macos
|
||||
|
||||
Reference in New Issue
Block a user