Files

45 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2026-05-23 22:10:14 +08:00
#!/usr/bin/env bash
#-------------------------------------------------
# 服务端相关开发工具
#-------------------------------------------------
if [ "" == "$ROOT" ]; then
if [ -f ../tools/dev.sh ]; then
../tools/dev.sh $@
exit 0
else
echo -e "\e[91m>>\e[0;0m 此脚本必须通过tools/dev.sh调用才能正常工作"
exit 1
fi
fi
DOC[h5_proto]="同步h5协议"
fun_h5_proto(){
if [ ! -d ${ROOT}/client_h5 ]; then
ERR "无法进入 ${ROOT}/client_h5 目录"
exit 1
fi
if [ ! -d ${ROOT}/tools/gen_proto/cli ]; then
ERR "无法进入 ${ROOT}/tools/gen_proto/cli 目录"
exit 1
fi
cd ${ROOT}/tools/gen_proto && git pull
yes|cp -f ${ROOT}/tools/gen_proto/cli/proto_mate.js ${ROOT}/client_h5/assets/scripts/net/
INFO "更新协议文件完成"
}
DOC[h5_make]="编译h5"
fun_h5_make(){
cd $ROOT/zsyz_client_h5
rm -rf build/*
$cocos_creator --path . --build "platform=web-mobile;configPath=build.json"
}
DOC[h5_config]="同步h5配置"
fun_h5_config(){
cd $ROOT/zsyz_client_h5
if [ -f assets/Scripts/config.js ]; then
fun_alert "配置文件[config.js]已存在 是否需要覆盖更新"
fi
cp -rf tpl/config.js assets/Scripts/
}