Skip to content

Commit e0c9b4e

Browse files
committed
chore: Add script to build local app
1 parent 12c1c46 commit e0c9b4e

3 files changed

Lines changed: 37 additions & 3 deletions

File tree

chat2db-client/script/local-client-build.sh

Whitespace-only changes.

chat2db-client/src/main/menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,21 @@ const registerAppMenu = (mainWindow, orgs) => {
110110
{
111111
label: '访问官网',
112112
click() {
113-
const url = 'https://chat2db.ai/';
113+
const url = 'https://www.sqlgpt.cn/zh';
114114
shell.openExternal(url);
115115
},
116116
},
117117
{
118118
label: '查看文档',
119119
click() {
120-
const url = 'https://doc.chat2db.ai/';
120+
const url = 'https://doc.sqlgpt.cn/zh/';
121121
shell.openExternal(url);
122122
},
123123
},
124124
{
125125
label: '查看更新日志',
126126
click() {
127-
const url = 'https://doc.chat2db.ai/changelog/';
127+
const url = 'https://doc.sqlgpt.cn/zh/changelog/';
128128
shell.openExternal(url);
129129
},
130130
},

script/local-client-build.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# JRE_DIR="${JAVA_HOME}/jre"
4+
JRE_DIR="~/Library/Java/JavaVirtualMachines/corretto-17.0.8.1/Contents/Home/"
5+
JRE_TARGET_DIR="chat2db-client/static/jre"
6+
CURRENT_ID="123"
7+
8+
# Clean
9+
echo "Clean"
10+
rm -rf chat2db-client/static
11+
rm -rf chat2db-client/versions
12+
rm -rf chat2db-client/release
13+
14+
# 使用 mkdir 创建目录,并使用 -p 参数确保如果目录已存在不会报错
15+
mkdir -p "$JRE_TARGET_DIR"
16+
17+
# 使用 cp 命令复制 JAVA_HOME 目录内容到目标目录
18+
# -r 参数表示递归复制整个目录
19+
cp -r "${JRE_DIR}/" "$JRE_TARGET_DIR"
20+
chmod -R 777 "$JRE_TARGET_DIR"
21+
22+
# 打包后端代码
23+
mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
24+
mkdir -p chat2db-client/versions/99.0.${CURRENT_ID}/static
25+
echo -n 99.0.${CURRENT_ID} > chat2db-client/versions/version
26+
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/99.0.${CURRENT_ID}/static/
27+
28+
# 打包前端代码
29+
cd chat2db-client
30+
yarn install
31+
yarn run build:web:desktop --app_port=10822
32+
cp -r dist ./versions/99.0.${CURRENT_ID}/
33+
# 打包客户端
34+
yarn run build:main:prod -c.productName=Chat2DB-Test -c.extraMetadata.version=99.0.${CURRENT_ID} --mac --arm64

0 commit comments

Comments
 (0)