Skip to content

Commit

Permalink
chore: move non-interactive start session a bit earlier, before evalu…
Browse files Browse the repository at this point in the history
…ating scripts
  • Loading branch information
kmruiz committed Nov 30, 2023
1 parent b2ebf96 commit 86190a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/cli-repl/src/cli-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,21 @@ export class CliRepl implements MongoshIOProvider {

if (willExecuteCommandLineScripts) {
this.mongoshRepl.setIsInteractive(willEnterInteractiveMode);

this.bus.emit('mongosh:start-session', {
isInteractive: false,
timings: summariseTimingData(getTimingData()),
});

this.bus.emit('mongosh:start-loading-cli-scripts', {
usesShellOption: !!this.cliOptions.shell,
});

const exitCode = await this.loadCommandLineFilesAndEval(
commandLineLoadFiles,
evalScripts
);

this.bus.emit('mongosh:start-session', {
isInteractive: false,
timings: summariseTimingData(getTimingData()),
});
if (exitCode !== 0) {
await this.exit(exitCode);
return;
Expand Down

0 comments on commit 86190a4

Please sign in to comment.