@@ -57,6 +57,7 @@ declare const __non_webpack_require__: any;
57
57
*/
58
58
export type MongoshCliOptions = ShellCliOptions & {
59
59
quiet ?: boolean ;
60
+ skipStartupWarnings ?: boolean ;
60
61
/**
61
62
* Whether to instantiate a Node.js REPL instance, including support
62
63
* for async error tracking, or not.
@@ -375,10 +376,12 @@ class MongoshNodeRepl implements EvaluationListener {
375
376
const { shellApi } = instanceState ;
376
377
// Assuming `instanceState.fetchConnectionInfo()` was already called above
377
378
const connectionInfo = instanceState . cachedConnectionInfo ( ) ;
378
- // Skipping startup warnings (see https://jira.mongodb.org/browse/MONGOSH-1776)
379
- const bannerCommands = connectionInfo ?. extraInfo ?. is_local_atlas
380
- ? [ 'automationNotices' , 'nonGenuineMongoDBCheck' ]
381
- : [ 'startupWarnings' , 'automationNotices' , 'nonGenuineMongoDBCheck' ] ;
379
+ // Skipping startup warnings (see https://jira.mongodb.org/browse/MONGOSH-1776 and https://jira.mongodb.org/browse/MONGOSH-2371)
380
+ const bannerCommands =
381
+ connectionInfo ?. extraInfo ?. is_local_atlas ||
382
+ this . shellCliOptions . skipStartupWarnings
383
+ ? [ 'automationNotices' , 'nonGenuineMongoDBCheck' ]
384
+ : [ 'startupWarnings' , 'automationNotices' , 'nonGenuineMongoDBCheck' ] ;
382
385
const banners = await Promise . all (
383
386
bannerCommands . map (
384
387
async ( command ) => await shellApi . _untrackedShow ( command )
0 commit comments