Skip to content

Commit 7373174

Browse files
committed
[eas-cli] print no vcs warning only once
1 parent 528988d commit 7373174

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/eas-cli/src/vcs/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ import { Client } from './vcs';
77

88
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.`;
99

10+
let wasNoVcsWarningPrinted = false;
11+
1012
export function resolveVcsClient(requireCommit: boolean = false): Client {
1113
if (process.env.EAS_NO_VCS) {
1214
if (process.env.NODE_ENV !== 'test') {
13-
// This log might be printed before cli arguments are evaluated,
14-
// so it needs to go to stderr in case command is run in JSON
15-
// only mode.
16-
// eslint-disable-next-line no-console
17-
console.error(chalk.yellow(NO_VCS_WARNING));
15+
if (!wasNoVcsWarningPrinted) {
16+
// This log might be printed before cli arguments are evaluated,
17+
// so it needs to go to stderr in case command is run in JSON
18+
// only mode.
19+
// eslint-disable-next-line no-console
20+
console.error(chalk.yellow(NO_VCS_WARNING));
21+
wasNoVcsWarningPrinted = true;
22+
}
1823
}
1924
return new NoVcsClient();
2025
}

0 commit comments

Comments
 (0)