fix: 修复 importSessions 中 result 变量重复声明导致编译失败
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PROJECT="/root/.openclaw/workspace/metona-ollama"
|
||||||
|
cd "$PROJECT"
|
||||||
|
|
||||||
|
echo "===== [1/6] 安装 Wine ====="
|
||||||
|
dpkg --add-architecture i386
|
||||||
|
apt-get update -qq 2>/dev/null || sed -i 's|http://mirrors.cloud.aliyuncs.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list && apt-get update -qq
|
||||||
|
apt-get install -y -qq wine wine32 2>&1 | tail -3
|
||||||
|
echo "Wine 安装完成: $(wine --version 2>/dev/null || echo 'installed')"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "===== [2/6] 安装 npm 依赖 ====="
|
||||||
|
cd "$PROJECT"
|
||||||
|
npm config set registry https://registry.npmmirror.com
|
||||||
|
npm install 2>&1 | tail -5
|
||||||
|
echo "npm install 完成"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "===== [3/6] 构建 Windows 安装包 ====="
|
||||||
|
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm run dist 2>&1 | tail -20
|
||||||
|
echo ""
|
||||||
|
echo "构建产物:"
|
||||||
|
ls -lh "$PROJECT/release/"*.exe 2>/dev/null || echo "未找到 exe 文件"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "===== BUILD SCRIPT DONE ====="
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "metona-ollama-desktop",
|
"name": "metona-ollama-desktop",
|
||||||
"version": "3.0.0",
|
"version": "3.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "metona-ollama-desktop",
|
"name": "metona-ollama-desktop",
|
||||||
"version": "3.0.0",
|
"version": "3.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.17.0",
|
"@types/node": "^20.17.0",
|
||||||
|
|||||||
@@ -271,9 +271,9 @@ async function importSessions(filePath: string): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await db.importSessions(sessions);
|
const importResult = await db.importSessions(sessions);
|
||||||
showToast(`导入完成:${result.imported} 个会话${result.skipped > 0 ? `,跳过 ${result.skipped} 个` : ''}`, 'success', 4000);
|
showToast(`导入完成:${importResult.imported} 个会话${importResult.skipped > 0 ? `,跳过 ${importResult.skipped} 个` : ''}`, 'success', 4000);
|
||||||
logSuccess(`导入完成: ${result.imported} 个, 跳过 ${result.skipped} 个`);
|
logSuccess(`导入完成: ${importResult.imported} 个, 跳过 ${importResult.skipped} 个`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showToast(`导入失败: ${(err as Error).message}`, 'error');
|
showToast(`导入失败: ${(err as Error).message}`, 'error');
|
||||||
logError('导入失败', (err as Error).message);
|
logError('导入失败', (err as Error).message);
|
||||||
|
|||||||
Reference in New Issue
Block a user