Browse Source

fix: 优化命令执行逻辑,使用串行执行以提高错误可见性

pull/8173/head
xingyu4j 2 months ago
parent
commit
5318774efe
  1. 10
      scripts/turbo-run/src/run.ts
  2. 11
      scripts/vsh/src/lint/index.ts

10
scripts/turbo-run/src/run.ts

@ -46,9 +46,13 @@ export async function run(options: RunOptions) {
process.exit(1); process.exit(1);
} }
execa('pnpm', [`--filter=${selectPkg}`, 'run', command], { try {
stdio: 'inherit', await execa('pnpm', [`--filter=${selectPkg}`, 'run', command], {
}); stdio: 'inherit',
});
} catch (error: any) {
process.exit(error.exitCode || 1);
}
} }
/** /**

11
scripts/vsh/src/lint/index.ts

@ -111,13 +111,12 @@ async function runLint({ format, threads }: LintCommandOptions) {
const threadsArg = `--threads=${threads || defaultThreads}`; const threadsArg = `--threads=${threads || defaultThreads}`;
if (format) { if (format) {
await runCommand([ await runSerial([
'stylelint', ['stylelint', ['**/*.{vue,css,less,scss}', '--cache', '--fix']],
['**/*.{vue,css,less,scss}', '--cache', '--fix'], ['oxfmt', [threadsArg]],
['oxlint', ['--fix', '--type-aware', threadsArg]],
['eslint', ['.', '--cache', '--fix']],
]); ]);
await runCommand(['oxfmt', [threadsArg]]);
await runCommand(['oxlint', ['--fix', '--type-aware', threadsArg]]);
await runCommand(['eslint', ['.', '--cache', '--fix']]);
return; return;
} }

Loading…
Cancel
Save