0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

Merge branch 'main' into astro-dot-session

This commit is contained in:
Matt Kane 2024-12-10 20:01:26 +00:00 committed by GitHub
commit 5a985acd6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes astro info copy to clipboard process not returning to prompt in certain cases.

View file

@ -0,0 +1,5 @@
---
'@astrojs/upgrade': patch
---
Fixes a bug that caused registry URLs that specify a port to be incorrectly detected as offline.

View file

@ -66,7 +66,7 @@ export async function copyToClipboard(text: string, force?: boolean) {
// Unix: check if a supported command is installed
const unixCommands: Array<[string, Array<string>]> = [
['xclip', ['-sel', 'clipboard', '-l', '1']],
['xclip', ['-selection', 'clipboard', '-l', '1']],
['wl-copy', []],
];
for (const [unixCommand, unixArgs] of unixCommands) {
@ -101,7 +101,7 @@ export async function copyToClipboard(text: string, force?: boolean) {
}
try {
const result = spawnSync(command, args, { input: text });
const result = spawnSync(command, args, { input: text, stdio: ['pipe', 'ignore', 'ignore'] });
if (result.error) {
throw result.error;
}

View file

@ -43,8 +43,8 @@ export async function verify(
}
function isOnline(registry: string): Promise<boolean> {
const { host } = new URL(registry);
return dns.lookup(host).then(
const { hostname } = new URL(registry);
return dns.lookup(hostname).then(
() => true,
() => false,
);