mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
telemetry: record isTTY (#8900)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
99b683aec1
commit
341ef65785
2 changed files with 10 additions and 3 deletions
7
.changeset/cold-jokes-buy.md
Normal file
7
.changeset/cold-jokes-buy.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
"@astrojs/telemetry": patch
|
||||
---
|
||||
|
||||
Track if the Astro CLI is running in a [`TTY`](nodejs.org/api/process.html#a-note-on-process-io) context.
|
||||
|
||||
This information helps us better understand scripted use of Astro vs. direct terminal use of Astro CLI by a user, especially the `astro dev` command.
|
|
@ -39,6 +39,7 @@ export type SystemInfo = {
|
|||
cpuSpeed: number | null;
|
||||
memoryInMb: number;
|
||||
isDocker: boolean;
|
||||
isTTY: boolean;
|
||||
isWSL: boolean;
|
||||
isCI: boolean;
|
||||
ciName: string | null;
|
||||
|
@ -53,7 +54,7 @@ export function getSystemInfo(versions: { viteVersion: string; astroVersion: str
|
|||
|
||||
const cpus = os.cpus() || [];
|
||||
|
||||
meta = {
|
||||
return {
|
||||
// Version information
|
||||
nodeVersion: process.version.replace(/^v?/, ''),
|
||||
viteVersion: versions.viteVersion,
|
||||
|
@ -69,10 +70,9 @@ export function getSystemInfo(versions: { viteVersion: string; astroVersion: str
|
|||
memoryInMb: Math.trunc(os.totalmem() / Math.pow(1024, 2)),
|
||||
// Environment information
|
||||
isDocker: isDocker(),
|
||||
isTTY: process.stdout.isTTY,
|
||||
isWSL,
|
||||
isCI,
|
||||
ciName,
|
||||
};
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue