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

Mise use defaults to installing globally if a .mise.toml doesn't already exist #2256

Closed
BoltsJ opened this issue Jun 5, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@BoltsJ
Copy link

BoltsJ commented Jun 5, 2024

Describe the bug
If a project doesn't already have a .mise.toml, running mise use to add a package will add it to the global configuration

To Reproduce
Steps to reproduce the behavior.

b@toolbox ~> mkdir myproj
b@toolbox ~> cd myproj/
b@toolbox ~/myproj> mise use yarn@latest
mise yarn@4.2.2 ✓ installed
mise ~/.config/mise/config.toml tools: yarn@4.2.2
b@toolbox ~/myproj> nvim ~/.config/mise/config.toml # remove the entry from the global config
b@toolbox ~/myproj> touch .mise.toml
b@toolbox ~/myproj> mise use yarn@latest
mise ~/myproj/.mise.toml tools: yarn@4.2.2
b@toolbox ~/myproj> 

Expected behavior
Mise should create and use a local .mise.toml unless the --global / -g flag is specified.

mise doctor output

b@toolbox ~/myproj> mise doctor 
version: 2024.6.1 linux-x64 (6a3f377 2024-06-03)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 3 Jun 2024 22:26:16 +0000
  Rust Version: rustc 1.78.0 (9b00956e5 2024-04-29)
  Profile: release

shell: 
  fish
  fish, version 3.7.0

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml
  ~/myproj/.mise.toml

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi

plugins: 
  bun      (core)
  deno     (core)
  erlang   (core)
  fd       https://gitlab.com/wt0f/asdf-fd.git#17d56e0
  fzf      https://github.com/kompiro/asdf-fzf.git#d19eb67
  go       (core)
  java     (core)
  neovim   https://github.com/richin13/asdf-neovim.git#d6118ad
  node     (core)
  pipx     https://github.com/yozachar/asdf-pipx.git#31db618
  python   (core)
  ripgrep  https://gitlab.com/wt0f/asdf-ripgrep.git#e836665
  ruby     (core)
  tokei    https://github.com/gasuketsu/asdf-tokei.git#d127410
  usage    https://github.com/jdx/mise-usage.git#fe3888a
  yarn     https://github.com/mise-plugins/asdf-yarn.git#74ea3b9

toolset: 
  yarn@4.2.2      
  fd@10.1.0       
  fzf@0.52.1      
  neovim@0.10.0   
  node@20.14.0    
  pipx@1.6.0      
  ripgrep@14.1.0  
  usage@0.3.0     

env_vars: 
  MISE_SHELL=fish

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "/var/home/b/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
No problems found

Additional context
Add any other context about the problem here. Consider running mise with --debug or --trace for extra debug info.

@BoltsJ BoltsJ added the bug Something isn't working label Jun 5, 2024
@jdx
Copy link
Owner

jdx commented Jun 5, 2024

Probably happening because it's recursing to find a .config directory. We should skip it if it's in the home directory in this case I think.

@BoltsJ
Copy link
Author

BoltsJ commented Aug 6, 2024

I believe that this has been fixed. Not sure when but it's working as expected now.

@BoltsJ BoltsJ closed this as completed Aug 6, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants