Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
重构所有代码和文档中的项目名称,将OpenFang统一更新为ZCLAW。包括: - 配置文件中的项目名称 - 代码注释和文档引用 - 环境变量和路径 - 类型定义和接口名称 - 测试用例和模拟数据 同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import { spawnSync } from 'node:child_process';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const desktopRoot = path.resolve(__dirname, '..');
|
|
const forwardArgs = process.argv.slice(2);
|
|
|
|
function run(command, args, extraEnv = {}) {
|
|
const result = spawnSync(command, args, {
|
|
cwd: desktopRoot,
|
|
stdio: 'inherit',
|
|
shell: process.platform === 'win32',
|
|
env: {
|
|
...process.env,
|
|
...extraEnv,
|
|
},
|
|
});
|
|
|
|
if (typeof result.status === 'number' && result.status !== 0) {
|
|
process.exit(result.status);
|
|
}
|
|
|
|
if (result.error) {
|
|
throw result.error;
|
|
}
|
|
}
|
|
|
|
const env = {};
|
|
if (!process.env.TAURI_BUNDLER_TOOLS_GITHUB_MIRROR && process.env.ZCLAW_TAURI_TOOLS_GITHUB_MIRROR) {
|
|
env.TAURI_BUNDLER_TOOLS_GITHUB_MIRROR = process.env.ZCLAW_TAURI_TOOLS_GITHUB_MIRROR;
|
|
}
|
|
if (!process.env.TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE && process.env.ZCLAW_TAURI_TOOLS_GITHUB_MIRROR_TEMPLATE) {
|
|
env.TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE = process.env.ZCLAW_TAURI_TOOLS_GITHUB_MIRROR_TEMPLATE;
|
|
}
|
|
|
|
run('node', ['scripts/prepare-zclaw-runtime.mjs']);
|
|
run('node', ['scripts/preseed-tauri-tools.mjs']);
|
|
run('pnpm', ['exec', 'tauri', 'build', ...forwardArgs], env);
|