Files

35 lines
1007 B
Bash
Raw Permalink Normal View History

2026-05-23 22:10:14 +08:00
#/bin/bash
# ---------------------------------------------------------
# 战场配置编译
# @author yeahoo2000@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[battle_all]="生成战场配置"
fun_battle_all(){
cd $ROOT/tools/gen_battle
$ERL -noshell -pa "../../server/ebin" -pa "./ebin" -eval "io:setopts([{encoding,unicode}]), make:all()" -eval "main:compile(all)" -s c q
rm -f ./ebin/*.beam
}
DOC[battle_lua]="生成战场Lua文件"
fun_battle_lua(){
cd $ROOT/tools/gen_battle
mkdir lua
$ERL -noshell -pa "../../server/ebin" -pa "./ebin" -eval "make:all()" -eval "main:gen_lua()" -s c q
rm -f ./ebin/*.beam
path=$ROOT/docs/trunk/editor/src/mod/battle/cfg
if [ -d $path ]; then
yes|cp -f lua/* $path/
fi
}