Files
cjyyzx/scripts/runNextDesktop.mts
xiaohei 428644e286
Revalidate Docs / Revalidate Docs (push) Failing after 2s
E2E CI / Check Duplicate Run (push) Failing after 5s
Test CI / Check Duplicate Run (push) Failing after 6s
E2E CI / Test Web App (push) Has been skipped
Test CI / Test Packages (push) Has been skipped
Test CI / Test App (shard 1/3) (push) Has been skipped
Test CI / Test App (shard 2/3) (push) Has been skipped
Test CI / Test App (shard 3/3) (push) Has been skipped
Test CI / Test Desktop App (push) Has been skipped
🔄 Branch Synchronization / sync-branches (push) Failing after 11s
Test CI / Test Database (push) Has been skipped
Test CI / Merge and Upload App Coverage (push) Has been skipped
Database Schema Visualization CI / build (push) Failing after 4m14s
Enterprise AI Workspace prototype: LobeChat (de-branded) + Enterprise Gateway + Postgres/Redis stack
2026-04-21 12:58:00 +08:00

34 lines
1008 B
TypeScript

import * as dotenv from 'dotenv';
import dotenvExpand from 'dotenv-expand';
import { spawn } from 'node:child_process';
import { existsSync } from 'node:fs';
import path from 'node:path';
const isDesktop = process.env.DESKTOP_BUILD === 'true';
if (isDesktop) {
const envDesktop = path.resolve(process.cwd(), '.env.desktop');
const envDesktopLocal = path.resolve(process.cwd(), '.env.desktop.local');
if (existsSync(envDesktop)) dotenvExpand.expand(dotenv.config({ path: envDesktop }));
if (existsSync(envDesktopLocal))
dotenvExpand.expand(dotenv.config({ override: true, path: envDesktopLocal }));
}
const nextBin = path.resolve(process.cwd(), 'node_modules', 'next', 'dist', 'bin', 'next');
const args = process.argv.slice(2);
const child = spawn(process.execPath, [nextBin, ...args], {
env: process.env,
stdio: 'inherit',
});
child.on('exit', (code, signal) => {
if (typeof code === 'number') {
process.exitCode = code;
return;
}
process.exitCode = signal ? 1 : 0;
});