From 3669e2d2762bf8a4909be00ed212a6c5e847eedf Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 10 Jul 2023 19:08:18 +0100 Subject: [PATCH] fix: `astro info` command fallback for package manager (#7618) --- .changeset/orange-mails-marry.md | 5 +++++ packages/astro/src/cli/index.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-mails-marry.md diff --git a/.changeset/orange-mails-marry.md b/.changeset/orange-mails-marry.md new file mode 100644 index 000000000..23e9c4ba6 --- /dev/null +++ b/.changeset/orange-mails-marry.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Add a fallback label if `astro info` command can't determine the package manager used. diff --git a/packages/astro/src/cli/index.ts b/packages/astro/src/cli/index.ts index bf9473f90..e4358ca24 100644 --- a/packages/astro/src/cli/index.ts +++ b/packages/astro/src/cli/index.ts @@ -112,8 +112,9 @@ async function printInfo({ } } catch (_e) {} console.log(); + const packageManagerName = packageManager?.name ?? "Couldn't determine."; printRow('Astro version', `v${ASTRO_VERSION}`); - printRow('Package manager', packageManager?.name); + printRow('Package manager', packageManagerName); printRow('Platform', platform()); printRow('Architecture', arch()); printRow('Adapter', adapter);