diff --git a/.changeset/cool-badgers-allow.md b/.changeset/cool-badgers-allow.md new file mode 100644 index 0000000..ac42a12 --- /dev/null +++ b/.changeset/cool-badgers-allow.md @@ -0,0 +1,5 @@ +--- +'@emigrate/cli': patch +--- + +The default reporter now prints the full command output once a command is done (in interactive mode) so that the full output is visible no matter the size of the terminal window. diff --git a/packages/cli/src/reporters/default.ts b/packages/cli/src/reporters/default.ts index cd69c58..f92511c 100644 --- a/packages/cli/src/reporters/default.ts +++ b/packages/cli/src/reporters/default.ts @@ -295,7 +295,7 @@ class DefaultFancyReporter implements Required { } } - #render(): void { + #render(flush = false): void { const parts = [ getTitle(this.#parameters), getHeaderMessage(this.#migrations, this.#lockedMigrations), @@ -303,7 +303,17 @@ class DefaultFancyReporter implements Required { getSummary(this.#parameters.command, this.#migrations), getError(this.#error), ]; - logUpdate('\n' + parts.filter(Boolean).join('\n\n') + '\n'); + + const output = '\n' + parts.filter(Boolean).join('\n\n') + '\n'; + + if (flush) { + logUpdate.clear(); + logUpdate.done(); + console.log(output); + return; + } + + logUpdate(output); } #start(): void { @@ -319,7 +329,7 @@ class DefaultFancyReporter implements Required { this.#interval = undefined; } - this.#render(); + this.#render(true); } }