summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Armand Philippot <59021693+ArmandPhilippot@users.noreply.github.com> 2024-05-09 19:37:21 +0200
committerGravatar GitHub <noreply@github.com> 2024-05-09 13:37:21 -0400
commit370b9f16124e890c23694220c4f668352489a4ed (patch)
tree16b8e96ba5acedd8868ff2c8386c5c2952b0cc16
parente2cdd3c96b22016cbab57f61b4bc67ac87f2fc00 (diff)
downloadastro-370b9f16124e890c23694220c4f668352489a4ed.tar.gz
astro-370b9f16124e890c23694220c4f668352489a4ed.tar.zst
astro-370b9f16124e890c23694220c4f668352489a4ed.zip
fix: exec command on Astro new version message (#10991)
`getExecCommand` is an async function but it wasn't awaited in `newVersionAvailable` so the message was: `Run [object Promise] @astrojs/upgrade to update`
-rw-r--r--packages/astro/src/core/dev/dev.ts2
-rw-r--r--packages/astro/src/core/messages.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts
index 34551f856..e0a25d75b 100644
--- a/packages/astro/src/core/dev/dev.ts
+++ b/packages/astro/src/core/dev/dev.ts
@@ -67,7 +67,7 @@ export default async function dev(inlineConfig: AstroInlineConfig): Promise<DevS
logger.warn(
'SKIP_FORMAT',
- msg.newVersionAvailable({
+ await msg.newVersionAvailable({
latestVersion: version,
})
);
diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts
index 01d571cff..25d66a590 100644
--- a/packages/astro/src/core/messages.ts
+++ b/packages/astro/src/core/messages.ts
@@ -105,10 +105,10 @@ export function serverShortcuts({ key, label }: { key: string; label: string }):
return [dim(' Press'), key, dim('to'), label].join(' ');
}
-export function newVersionAvailable({ latestVersion }: { latestVersion: string }) {
+export async function newVersionAvailable({ latestVersion }: { latestVersion: string }) {
const badge = bgYellow(black(` update `));
const headline = yellow(`▶ New version of Astro available: ${latestVersion}`);
- const execCommand = getExecCommand();
+ const execCommand = await getExecCommand();
const details = ` Run ${cyan(`${execCommand} @astrojs/upgrade`)} to update`;
return ['', `${badge} ${headline}`, details, ''].join('\n');