From 2a584fb0e17b7c5a5ca692e2d2edb892ac6ff815 Mon Sep 17 00:00:00 2001 From: Benjamin Fischer Date: Sun, 5 May 2024 15:32:42 +0200 Subject: [PATCH] some cleanup --- command/upgrade/upgrade_command.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/command/upgrade/upgrade_command.ts b/command/upgrade/upgrade_command.ts index f6a690b7..484666a3 100644 --- a/command/upgrade/upgrade_command.ts +++ b/command/upgrade/upgrade_command.ts @@ -38,14 +38,14 @@ export class UpgradeCommand extends Command { { default: this.getProvider().name, hidden: this.providers.length < 2, - value: (registry?: string) => this.getProvider(registry), + value: (registry) => this.getProvider(registry), }, ) .option( "-l, --list-versions", "Show available versions.", { - action: async ({ registry }: { registry: Provider }) => { + action: async ({ registry }) => { await registry.listVersions( this.getMainCommand().getName(), this.getVersion(), @@ -55,7 +55,7 @@ export class UpgradeCommand extends Command { }, ) .option( - "--version ", + "--version ", "The version to upgrade to.", { default: "latest" }, ) @@ -70,18 +70,14 @@ export class UpgradeCommand extends Command { if ( force || !currentVersion || - await (registry as Provider).isOutdated( - name, - currentVersion, - targetVersion as string, - ) + await registry.isOutdated(name, currentVersion, targetVersion) ) { - await (registry as Provider).upgrade({ + await registry.upgrade({ name, main, importMap, from: currentVersion, - to: targetVersion as string, + to: targetVersion, args, }); }