setup: show script logs only in verbose mode

This commit is contained in:
Abdullah Atta
2025-10-04 10:37:51 +05:00
parent 7509766df2
commit 33194dc9f0

View File

@@ -25,7 +25,10 @@ import path from "path";
import { fileURLToPath } from "url";
import parser from "yargs-parser";
const args = parser(process.argv, { alias: { force: ["-f"] } });
const args = parser(process.argv, {
alias: { force: ["-f"], verbose: ["-v"] }
});
const isVerbose = process.env.CI || args.verbose;
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const config = JSON.parse(
@@ -83,7 +86,7 @@ async function runScript(command, pkg) {
return new Promise((resolve, reject) => {
const child = spawn("npm", ["run", command], {
cwd: pkg,
stdio: "inherit",
stdio: isVerbose ? "inherit" : "pipe",
shell: true
});