Forest_Client/Tool/Luban/linux_export.sh

55 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
echo "Start export config ...\n"
CUR_PATH=`pwd`
echo "current work path:$CUR_PATH\n\n\n"
python3 auto.py
file_path="./result"
text=$(cat "$file_path")
if [ "$text" = "ok" ]; then
echo "所有配置下载成功"
echo "next" > $file_path
else
echo "配置下载失败请检查log"
cat ./download.log
echo "exit" > $file_path
exit
fi
PATH_LUBAN_DLL=$CUR_PATH/Luban.ClientServer/Luban.ClientServer.dll
INPUT_DATA_DIR=$CUR_PATH/Datas
PATH_DEFINE_FILE=$CUR_PATH/Defines/__root__.xml
OUTPUT_CODE_DIR=$CUR_PATH/code
OUTPUT_DATA_DIR=$CUR_PATH/data
rm -rf $OUTPUT_CODE_DIR
rm -rf $OUTPUT_DATA_DIR
mkdir -p $OUTPUT_CODE_DIR
mkdir -p $OUTPUT_DATA_DIR
echo "start export .."
dotnet $PATH_LUBAN_DLL -j cfg -- \
--input_data_dir $INPUT_DATA_DIR \
--output_code_dir $OUTPUT_CODE_DIR \
--output_data_dir $OUTPUT_DATA_DIR \
--gen_types data_json,code_go_json -s server \
--define_file $PATH_DEFINE_FILE \
--go:bright_module_name xsf_cfg
find $OUTPUT_CODE_DIR -type f -exec sed -i.bak 's/package cfg/package xsf_scp/g' {} +
cp -rf $OUTPUT_CODE_DIR/*.go ~/WLGCZ/schema/
cp -rf $OUTPUT_DATA_DIR/*.json ~/WLGCZ/bin/scp/
rm -rf $OUTPUT_CODE_DIR
rm -rf $OUTPUT_DATA_DIR
echo "export done ..."