Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warning when sidekick init would downgrade the cli #163

Open
passsy opened this issue Jan 4, 2023 · 2 comments
Open

Show warning when sidekick init would downgrade the cli #163

passsy opened this issue Jan 4, 2023 · 2 comments
Labels
good first issue Good for newcomers sidekick https://pub.dev/packages/sidekick

Comments

@passsy
Copy link
Contributor

passsy commented Jan 4, 2023

In the past, we used sidekick init to "upgrade" a sidekick cli to the latest template version.

Now it may happen, that a user calls sidekick init with an outdated sidekick version, basically downgrading the sidekick package.

We can prevent this by checking the version in pubspec.yaml and compare it to the version of sidekick_core.

@passsy passsy added good first issue Good for newcomers sidekick https://pub.dev/packages/sidekick labels Jan 4, 2023
@danielmolnar
Copy link

Isn't this being prevented by the following bit within UpdateCommand?

    if (versionToInstall <= currentSidekickCliVersion) {
      print('No need to update because you are already using the '
          'latest sidekick cli version.');
      return;
    }

@passsy
Copy link
Contributor Author

passsy commented Jan 5, 2023

The UpdateCommand is not used, it's the InitCommand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers sidekick https://pub.dev/packages/sidekick
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants