Skip to content

Commit

Permalink
fixup: leave unchanged code as-is
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Sep 21, 2023
1 parent 911035c commit da86a39
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/cli-repl/src/mongosh-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,11 @@ class MongoshNodeRepl implements EvaluationListener {
let mongodVersion = extraInfo?.is_stream
? 'Atlas Stream Processing'
: buildInfo?.version;
if (!extraInfo?.is_stream) {
const apiVersion = serviceProvider.getRawClient()?.serverApi?.version;
if (apiVersion) {
mongodVersion =
(mongodVersion ? mongodVersion + ' ' : '') +
`(API Version ${apiVersion})`;
}
const apiVersion = serviceProvider.getRawClient()?.serverApi?.version;
if (apiVersion) {
mongodVersion =
(mongodVersion ? mongodVersion + ' ' : '') +
`(API Version ${apiVersion})`;
}
await this.greet(mongodVersion, moreRecentMongoshVersion);
await this.printBasicConnectivityWarning(instanceState);
Expand Down Expand Up @@ -461,15 +459,15 @@ class MongoshNodeRepl implements EvaluationListener {
* The greeting for the shell, showing server and shell version.
*/
async greet(
mongodVersion?: string,
mongodVersion: string,
moreRecentMongoshVersion?: string | null
): Promise<void> {
if (this.shellCliOptions.quiet) {
return;
}
const { version } = require('../package.json');
let text = '';
if (mongodVersion && !this.shellCliOptions.nodb) {
if (!this.shellCliOptions.nodb) {
text += `Using MongoDB:\t\t${mongodVersion}\n`;
}
text += `${this.clr(
Expand Down

0 comments on commit da86a39

Please sign in to comment.