From 737317402bd7e622900b35019997f63232013696 Mon Sep 17 00:00:00 2001 From: Szymon Dziedzic Date: Tue, 4 Feb 2025 09:58:42 +0100 Subject: [PATCH] [eas-cli] print no vcs warning only once --- packages/eas-cli/src/vcs/index.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/eas-cli/src/vcs/index.ts b/packages/eas-cli/src/vcs/index.ts index 82a2526b24..a65b1f5d1e 100644 --- a/packages/eas-cli/src/vcs/index.ts +++ b/packages/eas-cli/src/vcs/index.ts @@ -7,14 +7,19 @@ import { Client } from './vcs'; const NO_VCS_WARNING = `Using EAS CLI without version control system is not recommended, use this mode only if you know what you are doing.`; +let wasNoVcsWarningPrinted = false; + export function resolveVcsClient(requireCommit: boolean = false): Client { if (process.env.EAS_NO_VCS) { if (process.env.NODE_ENV !== 'test') { - // This log might be printed before cli arguments are evaluated, - // so it needs to go to stderr in case command is run in JSON - // only mode. - // eslint-disable-next-line no-console - console.error(chalk.yellow(NO_VCS_WARNING)); + if (!wasNoVcsWarningPrinted) { + // This log might be printed before cli arguments are evaluated, + // so it needs to go to stderr in case command is run in JSON + // only mode. + // eslint-disable-next-line no-console + console.error(chalk.yellow(NO_VCS_WARNING)); + wasNoVcsWarningPrinted = true; + } } return new NoVcsClient(); }