Skip to content

Conversation

@toshimaru
Copy link
Member

@toshimaru toshimaru commented May 4, 2025

grep version with version prefix.

[SKIP] mise_use node on localhost
Running mise ls yarn | grep '\s1' on localhost
yarn  1.22.22
  • install yarn@1
    • πŸ™…β€β™‚οΈ yarn 4.2.1 (patch version matched)
    • πŸ™†β€β™‚οΈ yarn 1.22.1 (major version matched)

@toshimaru toshimaru force-pushed the fix-version-grep branch from 18794ae to c4608ed Compare May 4, 2025 05:01
`install yarn@1` should match major version of the version.

```
[SKIP] mise_use node on localhost
Running mise ls yarn | grep '\s1' on localhost
yarn  1.22.22
```
@toshimaru toshimaru force-pushed the fix-version-grep branch from c4608ed to d53c0f2 Compare May 4, 2025 05:01
@toshimaru toshimaru changed the title Update mise_install.rb fix: Grep version with version prefix May 4, 2025
@toshimaru toshimaru marked this pull request as ready for review May 4, 2025 23:27
Copilot AI review requested due to automatic review settings May 4, 2025 23:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to fix the version matching in the grep command by ensuring that only versions with a proper prefix (whitespace) are matched.

  • Updated grep command to match whitespace preceding the version string.
  • Removed an extra space before "mise ls" in the command.
Comments suppressed due to low confidence (1)

lib/serverkit/resources/mise_install.rb:18

  • Consider verifying that the '\s' shorthand is supported in the target grep environment. If portability is a concern, you might use a POSIX character class such as '[[:space:]]' instead.
check_command("mise ls #{name} | grep '\s#{version_or_latest}'")

@toshimaru toshimaru merged commit b199bbe into main May 4, 2025
12 checks passed
@toshimaru toshimaru deleted the fix-version-grep branch May 4, 2025 23:44
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.

2 participants