chore(repo): make runCLI work in verbose mode (#13123)

This commit is contained in:
Jason Jean 2022-11-10 23:15:14 -05:00 committed by GitHub
parent 5f47917ce0
commit 16c3a2eb20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -592,15 +592,18 @@ export function runCLI(
): string { ): string {
try { try {
const pm = getPackageManagerCommand(); const pm = getPackageManagerCommand();
let r = stripConsoleColors( const logs = execSync(`${pm.runNx} ${command}`, {
execSync(`${pm.runNx} ${command}`, { cwd: opts.cwd || tmpProjPath(),
cwd: opts.cwd || tmpProjPath(), env: { CI: 'true', ...(opts.env || process.env) },
env: { CI: 'true', ...(opts.env || process.env) }, encoding: 'utf-8',
encoding: 'utf-8', stdio: 'pipe',
stdio: isVerbose() ? 'inherit' : 'pipe', maxBuffer: 50 * 1024 * 1024,
maxBuffer: 50 * 1024 * 1024, });
}) const r = stripConsoleColors(logs);
);
if (isVerbose()) {
console.log(logs);
}
const needsMaxWorkers = /g.*(express|nest|node|web|react):app.*/; const needsMaxWorkers = /g.*(express|nest|node|web|react):app.*/;
if (needsMaxWorkers.test(command)) { if (needsMaxWorkers.test(command)) {