Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed May 5, 2024
1 parent 4881b7d commit 2a584fb
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions command/upgrade/upgrade_command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -55,7 +55,7 @@ export class UpgradeCommand extends Command {
},
)
.option(
"--version <version:string>",
"--version <version:string:version>",
"The version to upgrade to.",
{ default: "latest" },
)
Expand All @@ -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,
});
}
Expand Down

0 comments on commit 2a584fb

Please sign in to comment.