Reinstate support for updating locally-installed extensions (#8833)

This commit is contained in:
christine betts
2025-09-21 23:44:58 -04:00
committed by GitHub
parent 8fdb61aabf
commit d9828e2571
6 changed files with 111 additions and 37 deletions
@@ -20,7 +20,6 @@ interface InstallArgs {
export async function handleInstall(args: InstallArgs) {
try {
let installMetadata: ExtensionInstallMetadata;
if (args.source) {
const { source } = args;
if (
+23 -23
View File
@@ -35,28 +35,7 @@ export async function handleUpdate(args: UpdateArgs) {
allExtensions.map((e) => e.config.name),
workingDir,
);
if (args.all) {
try {
let updateInfos = await updateAllUpdatableExtensions(
workingDir,
extensions,
await checkForAllExtensionUpdates(extensions, new Map(), (_) => {}),
() => {},
);
updateInfos = updateInfos.filter(
(info) => info.originalVersion !== info.updatedVersion,
);
if (updateInfos.length === 0) {
console.log('No extensions to update.');
return;
}
console.log(updateInfos.map((info) => updateOutput(info)).join('\n'));
} catch (error) {
console.error(getErrorMessage(error));
}
}
if (args.name)
if (args.name) {
try {
const extension = extensions.find(
(extension) => extension.name === args.name,
@@ -99,10 +78,31 @@ export async function handleUpdate(args: UpdateArgs) {
} catch (error) {
console.error(getErrorMessage(error));
}
}
if (args.all) {
try {
let updateInfos = await updateAllUpdatableExtensions(
workingDir,
extensions,
await checkForAllExtensionUpdates(extensions, new Map(), (_) => {}),
() => {},
);
updateInfos = updateInfos.filter(
(info) => info.originalVersion !== info.updatedVersion,
);
if (updateInfos.length === 0) {
console.log('No extensions to update.');
return;
}
console.log(updateInfos.map((info) => updateOutput(info)).join('\n'));
} catch (error) {
console.error(getErrorMessage(error));
}
}
}
export const updateCommand: CommandModule = {
command: 'update [--all] [name]',
command: 'update [<name>] [--all]',
describe:
'Updates all extensions or a named extension to the latest version.',
builder: (yargs) =>