Skip to content

Conversation

@toshimaru
Copy link
Member

@toshimaru toshimaru commented Apr 24, 2025

Setting

  - type: mise_use
    global: false
    name: ruby
    version: '3.3'
  - type: mise_use
    name: ruby
    global: true

Result

$ bundle exec serverkit apply serverkit.yml.erb --log-level=DEBUG
...
Running mise ls --current ruby | grep '3.3' on localhost
ruby  3.3.8  ~/src/github.com/toshimaru/dotfiles/mise.toml  3.3
Finished with 0 on localhost
[SKIP] mise_use ruby on localhost
Running mise ls --cd $HOME ruby | grep 'latest' on localhost
ruby  3.4.3  ~/.config/mise/config.toml  latest
Finished with 0 on localhost
[SKIP] mise_use ruby on localhost

@toshimaru toshimaru marked this pull request as ready for review April 26, 2025 14:27
Copilot AI review requested due to automatic review settings April 26, 2025 14: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 adds a new global option to the mise resource, allowing users to specify whether a tool should be installed globally or not. Key changes include:

  • Adding a new attribute, global, with a default value of true in the mise_use resource.
  • Updating the command construction in apply and check methods to incorporate the global option.
  • Updating the README to document the new global option.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/serverkit/resources/mise_use.rb Adds a global attribute and updates command construction.
README.md Documents the new global option and its default behavior.
Comments suppressed due to low confidence (1)

lib/serverkit/resources/mise_use.rb:20

  • The use of '--cd $HOME' in the check method for the global case differs from the '--global' flag used in the apply method. Please confirm if this change is intentional and correctly reflects the intended global behavior.
mise ls --cd $HOME #{name} | grep '#{version_or_latest}'

# @note Override
def apply
run_command("mise use --global #{name_with_version}")
run_command("mise use #{global_option} #{name_with_version}")
Copy link

Copilot AI Apr 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider ensuring that global_option returns an empty string when global is false (or handle nil gracefully) to avoid unintended extra spaces in the command string.

Copilot uses AI. Check for mistakes.
@toshimaru toshimaru merged commit 8995290 into main Apr 26, 2025
8 checks passed
@toshimaru toshimaru deleted the add-global-option branch April 26, 2025 14:33
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