🎨 Continue using npm

This commit is contained in:
Tw93
2025-08-20 12:45:22 +08:00
parent 864db379c0
commit 1bb2522ab7
16 changed files with 597 additions and 2168 deletions

9
bin/utils/shell.ts vendored
View File

@@ -1,13 +1,18 @@
import { execa } from 'execa';
import { npmDirectory } from './dir';
export async function shellExec(command: string, timeout: number = 300000) {
export async function shellExec(
command: string,
timeout: number = 300000,
env?: Record<string, string>,
) {
try {
const { exitCode } = await execa(command, {
cwd: npmDirectory,
stdio: 'inherit',
stdio: ['inherit', 'pipe', 'inherit'], // Hide stdout verbose, keep stderr
shell: true,
timeout,
env: env ? { ...process.env, ...env } : process.env,
});
return exitCode;
} catch (error: any) {