Skip to content

Conversation

@joehorsnell
Copy link
Contributor

If you have Mise installed using a package manager, such as Homebrew, the plugin still prompts to install available updates, even though it will fail.

Ideally there would be data available in mise doctor, or some other command, to determine if we can self-update, but there is not, so this PR reimplements the is_available() function from SelfUpdate.

Fixes #122.

If you have Mise installed using a package manager, such as Homebrew, the plugin still prompts to install available
updates, even though it will fail.

Ideally there would be data available in `mise doctor`, or some other command, to determine if we can `self-update`, but
there is not, so this PR reimplements the [`is_available()` function from `SelfUpdate`](https://github.com/jdx/mise/blob/863505d4089126780c2352fb1218c6550c3cf9d8/src/cli/self_update.rs#L100).

Fixes hverlin#122.
@joehorsnell
Copy link
Contributor Author

Hi @hverlin - thanks for your work on the Mise VSCode plugin 👍.

I currently can't use the self-update feature of Mise at work because of jdx/mise#5459, so I'm just installing it via Homebrew, which nags me on each new version, so I thought I'd submit a fix for this issue.

There don't appear to be any tests for MiseService, but happy to add some if you suggest how? That class seems to be quite closely coupled to the VSCode extension API, as it takes a vscode.ExtensionContext in the constructor. I'm not too familiar with those APIs, so I'm not sure how to unit test those functions without getting into a mock-fest.

@hverlin
Copy link
Owner

hverlin commented Jul 5, 2025

Thank you for contributing! Ideally we should indeed rely on mise doctor output but this will do until it's eventually added to mise itself.

@hverlin hverlin merged commit af320fe into hverlin:main Jul 5, 2025
2 checks passed
@joehorsnell
Copy link
Contributor Author

Thank you for contributing! Ideally we should indeed rely on mise doctor output but this will do until it's eventually added to mise itself.

That was quick! Thanks @hverlin 👍

Will you cut a new release with this change in it?

@hverlin
Copy link
Owner

hverlin commented Jul 5, 2025

A new release should be available now ✅

joehorsnell added a commit to joehorsnell/jdx-mise that referenced this pull request Jul 5, 2025
joehorsnell added a commit to joehorsnell/jdx-mise that referenced this pull request Jul 7, 2025
jdx pushed a commit to jdx/mise that referenced this pull request Jul 7, 2025
Related to hverlin/mise-vscode#129.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hide update button if installed via package manager

2 participants