difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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}/zsyz_client_h5 ]; then
        ERR "无法进入 ${ROOT}/zsyz_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}/zsyz_client_h5/assets/scripts/net/
    INFO "更新协议文件完成"
}
 
DOC[h5_make]="编译h5"
fun_h5_make(){
    cd $ROOT/zsyz_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_zsyz_client_h5
    if [ -f assets/Scripts/config.js ]; then 
        fun_alert "配置文件[config.js]已存在 是否需要覆盖更新"
    fi
    cp -rf tpl/config.js assets/Scripts/
}