mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-04 02:52:55 +08:00
- Introduced a new `startup` module to capture and manage startup diagnostics. - Implemented logging functionality with daily rotation and error reporting for application startup failures. - Updated the main application run function to return an exit code based on startup success or failure. - Added new dependencies for logging and diagnostics in `Cargo.toml`. - Increased request timeout in the control service for improved stability. - Expanded maximum search results in the federation module for better search capabilities.
23 lines
822 B
JavaScript
23 lines
822 B
JavaScript
import { existsSync } from 'node:fs';
|
|
import { spawnSync } from 'node:child_process';
|
|
import { fileURLToPath } from 'node:url';
|
|
import path from 'node:path';
|
|
|
|
const docsRoot = path.dirname(fileURLToPath(new URL('../package.json', import.meta.url)));
|
|
const desktopRoot = path.resolve(docsRoot, '../desktop');
|
|
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
const vite = path.join(desktopRoot, 'node_modules', '.bin', process.platform === 'win32' ? 'vite.cmd' : 'vite');
|
|
|
|
if (!existsSync(vite)) run(['ci'], desktopRoot);
|
|
run(['run', 'build:demo'], desktopRoot);
|
|
|
|
function run(args, cwd) {
|
|
const result = spawnSync(npm, args, {
|
|
cwd,
|
|
stdio: 'inherit',
|
|
shell: process.platform === 'win32',
|
|
});
|
|
if (result.error) throw result.error;
|
|
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
}
|