提交 b9c0e3a7 authored 作者: Andy's avatar Andy

12

上级 abde6852
...@@ -18,7 +18,13 @@ PlatWeb_Branches=( ...@@ -18,7 +18,13 @@ PlatWeb_Branches=(
$GameWeb_Ranch $GameWeb_Ranch
) )
GameWeb_Repo_Url="git@git.wkwork.xyz:LaunchDeploy/wk_game_web.git" GameSvr_Repo_Url="git@git.wkwork.xyz:LaunchDeploy/wk_bdgame_svr.git"
GameSvr_Base_Dir="./gamesvr"
GameSvr_Branches=(
$GameSvr_Ranch
)
GameWeb_Repo_Url="git@git.wkwork.xyz:LaunchDeploy/wk_bdgame_web.git"
GameWeb_Base_Dir="./gameweb" GameWeb_Base_Dir="./gameweb"
GameWeb_Branches=( GameWeb_Branches=(
$GameWeb_Ranch $GameWeb_Ranch
...@@ -67,6 +73,10 @@ fetch_git_platweb() { ...@@ -67,6 +73,10 @@ fetch_git_platweb() {
bash <(curl -sSL $Fun_Script_Url/fun_git.sh) fetch_git $PlatWeb_Repo_Url $PlatWeb_Base_Dir $PlatWeb_Branches bash <(curl -sSL $Fun_Script_Url/fun_git.sh) fetch_git $PlatWeb_Repo_Url $PlatWeb_Base_Dir $PlatWeb_Branches
} }
fetch_git_gamesvr() {
bash <(curl -sSL $Fun_Script_Url/fun_git.sh) fetch_git $GameSvr_Repo_Url $GameWeb_Svr_Dir $GameSvr_Branches
}
fetch_git_gameweb() { fetch_git_gameweb() {
bash <(curl -sSL $Fun_Script_Url/fun_git.sh) fetch_git $GameWeb_Repo_Url $GameWeb_Base_Dir $GameWeb_Branches bash <(curl -sSL $Fun_Script_Url/fun_git.sh) fetch_git $GameWeb_Repo_Url $GameWeb_Base_Dir $GameWeb_Branches
} }
...@@ -99,10 +109,11 @@ run_service() { ...@@ -99,10 +109,11 @@ run_service() {
} }
# ------------------ 数组定义菜单项 ------------------ # ------------------ 数组定义菜单项 ------------------
MENU_ITEMS=( Memu_Items=(
"测试 Git 账户" "测试 Git 账户"
"获取 Plat Svr" "获取 Plat Svr"
"获取 Plat Web" "获取 Plat Web"
"获取 Game Svr"
"获取 Game Web" "获取 Game Web"
"运行 Docker" "运行 Docker"
"运行 Server" "运行 Server"
...@@ -111,10 +122,11 @@ MENU_ITEMS=( ...@@ -111,10 +122,11 @@ MENU_ITEMS=(
) )
# 每个编号对应一个函数(index 对齐 MENU_ITEMS) # 每个编号对应一个函数(index 对齐 MENU_ITEMS)
MENU_ACTIONS=( Mennu_Actions=(
"check_gitaccount" "check_gitaccount"
"fetch_git_platsvr" "fetch_git_platsvr"
"fetch_git_platweb" "fetch_git_platweb"
"fetch_git_gamesvr"
"fetch_git_gameweb" "fetch_git_gameweb"
"run_docker" "run_docker"
"run_service" "run_service"
...@@ -130,21 +142,21 @@ main() { ...@@ -130,21 +142,21 @@ main() {
echo_content "skyBlue" "============================" echo_content "skyBlue" "============================"
echo_content "red" " 安装游戏平台($GamePlatName) " echo_content "red" " 安装游戏平台($GamePlatName) "
echo_content "skyBlue" "============================" echo_content "skyBlue" "============================"
for i in "${!MENU_ITEMS[@]}"; do for i in "${!Memu_Items[@]}"; do
# printf " %2d) %s\n" "$((i + 1))" "${MENU_ITEMS[$i]}" # printf " %2d) %s\n" "$((i + 1))" "${Memu_Items[$i]}"
# echo_content "skyBlue" " $((i + 1))) ${MENU_ITEMS[$i]}" # echo_content "skyBlue" " $((i + 1))) ${Memu_Items[$i]}"
echo_content "blue" " $((i + 1))) " -n echo_content "blue" " $((i + 1))) " -n
echo_content "green" "${MENU_ITEMS[$i]}" echo_content "green" "${Memu_Items[$i]}"
done done
echo_content "skyBlue" "============================" echo_content "skyBlue" "============================"
echo_content "skyBlue" "请选择操作: " -n echo_content "skyBlue" "请选择操作: " -n
read -r choice read -r choice
# 转为下标(减 1) # 转为下标(减 1)
if [[ "$choice" =~ ^[0-9]+$ ]] && [ "$choice" -ge 1 ] && [ "$choice" -le "${#MENU_ITEMS[@]}" ]; then if [[ "$choice" =~ ^[0-9]+$ ]] && [ "$choice" -ge 1 ] && [ "$choice" -le "${#Memu_Items[@]}" ]; then
index=$((choice - 1)) index=$((choice - 1))
echo_content "skyBlue" ">> 执行: ${MENU_ITEMS[$index]}" echo_content "skyBlue" ">> 执行: ${Memu_Items[$index]}"
eval "${MENU_ACTIONS[$index]}" eval "${Mennu_Actions[$index]}"
else else
echo_content "skyBlue" "无效选择。" echo_content "skyBlue" "无效选择。"
fi fi
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论