Files
fc/server/tools/gen_data/web_gen_data.sh
T

77 lines
2.0 KiB
Bash
Raw Normal View History

2026-05-23 22:10:14 +08:00
#/bin/bash
# ---------------------------------------------------------
# 配置数据生成工具
# @author whjing2011@gmail.com
# ---------------------------------------------------------
if [ "" == "$ROOT" ]; then
if [ -f ../dev.sh ]; then
../dev.sh $@
exit 0
else
echo -e "\e[91m>>\e[0;0m 此脚本必须通过tools/dev.sh调用才能正常工作"
exit 1
fi
fi
DOC[web_gen_data]="web生成目标数据配置文件"
fun_web_gen_data(){
start_time=$(date +%s)
cd ${ROOT}/tools/
if [ "$1" == "" ]; then
echo "请输入模块名"
exit 1
fi
python ebin/gen_data.pyc gen_data $ROOT $1
INFO "生成数据[$1]完成:$(expr `date +%s` - $start_time)"
}
DOC[web_gen_data_demo]="web生成目标数据配置文件demo例子"
fun_web_gen_data_demo(){
start_time=$(date +%s)
cd ${ROOT}/tools/
if [ "$1" == "" ]; then
echo "请输入模块名"
exit 1
fi
mkdir -p gen_data/out
python ebin/gen_data.pyc gen_data_demo $ROOT $1
INFO "生成数据[$1]完成:$(expr `date +%s` - $start_time)"
}
DOC[web_get_dev_data]="web获取测试服数据"
fun_web_get_dev_data(){
start_time=$(date +%s)
cd ${ROOT}/tools/
if [ "$1" == "" ]; then
echo "请输入模块名"
exit 1
fi
python ebin/gen_data.pyc get_dev_data $ROOT $1
INFO "获取数据[$1]完成:$(expr `date +%s` - $start_time)"
}
DOC[web_gen_xml]="web生成数据文件 XML"
fun_web_gen_xml(){
cd ${ROOT}/tools/
if [ "$1" == "" ]; then
echo "请输入模块名"
exit 1
fi
mkdir -p gen_data/template
python ebin/gen_data.pyc gen_xml $ROOT $1
}
DOC[web_gen_data_cfg]="web生成新数据文件gen_data/cfg/*.erl"
fun_web_gen_data_cfg(){
cd ${ROOT}/tools/
if [ "$1" == "" ]; then
echo "请输入模块名"
exit 1
elif [ -f gen_data/cfg/$1.erl ]; then
echo "配置文件已存在"
exit 1
fi
python ebin/gen_data.pyc gen_data_cfg $ROOT $1
}