Skip to content

Commit c8b34b2

Browse files
committed
publish: more compact status display when running in CI environments
1 parent 0565d04 commit c8b34b2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

news/changelog-1.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
## Publishing
6565

6666
- Detect authentication error for quarto.pub and re-establish credentials
67+
- More compact status display when running in CI environments
6768

6869
## Miscellaneous
6970

src/core/console.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { ansi } from "cliffy/ansi/mod.ts";
99
import { readAllSync, writeAllSync } from "io/mod.ts";
1010
import { info } from "log/mod.ts";
11+
import { runningInCI } from "./ci-info.ts";
1112

1213
// The spinner and progress characters
1314
const kSpinnerChars = ["|", "/", "-", "\\"];
@@ -88,7 +89,9 @@ export function spinner(
8889
return status;
8990
}
9091
: () => {
91-
clearLine();
92+
if (!runningInCI()) {
93+
clearLine();
94+
}
9295
return status();
9396
};
9497

@@ -97,9 +100,13 @@ export function spinner(
97100
// Display the message
98101
const char = kSpinnerChars[spin % kSpinnerChars.length];
99102
const msg = `${spinContainer(char)} ${statusFn()}`;
100-
info(`\r${msg}`, {
101-
newline: false,
102-
});
103+
104+
// when running in CI only show the first tick
105+
if (!runningInCI() || spin === 0) {
106+
info(`\r${msg}`, {
107+
newline: false,
108+
});
109+
}
103110

104111
// Increment the spin counter
105112
spin = spin + 1;

0 commit comments

Comments
 (0)