Skip to content

Commit 919e81f

Browse files
jamogatsbybot
and
gatsbybot
authored
chore(telemetry) Add isTTY (#27780)
* Add isTTY * Simplify Co-authored-by: gatsbybot <[email protected]>
1 parent 1367a32 commit 919e81f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/gatsby-telemetry/src/telemetry.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ interface IOSInfo {
3030
ci: boolean | undefined
3131
ciName: string | null
3232
docker: boolean | undefined
33+
isTTY: boolean
3334
}
3435

3536
export interface IAggregateStats {
@@ -336,6 +337,10 @@ export class AnalyticsTracker {
336337
}
337338
}
338339

340+
getIsTTY(): boolean {
341+
return Boolean(process.stdout?.isTTY)
342+
}
343+
339344
getMachineId(): string {
340345
// Cache the result
341346
if (this.machineId) {
@@ -381,6 +386,7 @@ export class AnalyticsTracker {
381386
ci: isCI(),
382387
ciName: getCIName(),
383388
docker: isDocker(),
389+
isTTY: this.getIsTTY(),
384390
}
385391
this.osInfo = osInfo
386392
return osInfo

0 commit comments

Comments
 (0)