| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #!/bin/bash
- echo "[EXCEL] build excel files..."
- # 检查并进入仓库根目录
- repo_root=$(git rev-parse --show-toplevel 2>/dev/null || true)
- if [[ -z "$repo_root" ]]; then
- echo "未检测到源码git仓库,请在项目仓库内运行此脚本。"
- exit 1
- fi
- if [[ -z "$repo_root/_excel/" ]]; then
- echo "未检测到_excel git仓库,请在项目仓库内运行此脚本。"
- exit 1
- fi
- excel_path="$repo_root/_excel/"
- excel_bin_path="$repo_root/_excel/bin/"
- data_path="$repo_root/etc/data"
- data_map_path="$repo_root/etc/data_map/"
- go_path="$repo_root/internal/data"
- echo "repo_root = $repo_root"
- echo "excel_path = $excel_path"
- echo "excel_bin_path = $excel_bin_path"
- echo "data_path = $data_path"
- echo "go_path = $go_path"
- echo ""
- pushd "$excel_bin_path"
- if [[ "$(uname -s)" == "MINGW"* ]]; then
- ./ee.exe --path=./server.json
- else
- ./ee_linux --path=./server.json
- fi
- popd
- echo "[EXCEL] copy json files to $data_path"
- cp -rf $excel_path/output/server_json/*.json $data_path
- echo "[EXCEL] copy go files to $go_path"
- cp -rf $excel_path/output/server_go/*.go $go_path
- rm -rf $excel_path/output
- echo "[EXCEL] copy embed data files"
- cp -rf $repo_root/etc/data_embed/*.json $data_path
- echo "[EXCEL] copy map data files"
- cp -rf $excel_path/data_map/* $data_map_path
- echo "[EXCEL] build excel files is complete!"
|