Skip to content

Conversation

@vmeurisse
Copy link
Contributor

@vmeurisse vmeurisse commented Nov 14, 2025

Summary

Current bootstrap code switch directory to the project directory on first install (which is hardcoded to be 2 parents up from the bootstrap script).
This fails when calling command with relative path, if the project directory is not 2 level up, or if the user was not at the root of the project.
Once mise is installed, no directory change happen.

$ /bin/mise generate bootstrap --write mise.sh
Wrote to mise.sh
$ rm ~/.cache/mise/mise-2025.11.4
$ ./mise.sh exec -- ./test.sh
mise: installing mise...
################################################################################################################################################### 100.0%
mise: installed successfully to /home/user/.cache/mise/mise-2025.11.4
mise ERROR "./test.sh" couldn't exec process: No such file or directory
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
$ ./mise.sh exec -- ./test.sh
OK

This fix restore the current working directory after install.
I also simplified the code that generate project_dir to avoid 2 subshell.

Test plan

Manually tested the generated bootstrap with and without the --localize option.

$ cargo run generate bootstrap --write mise.sh
Wrote to mise.sh
$ rm ~/.cache/mise/mise-2025.11.4
$ ./mise.sh exec -- ./test.sh
mise: installing mise...
################################################################################################################################################### 100.0%
mise: installed successfully to /home/user/.cache/mise/mise-2025.11.4
OK
$ ./mise.sh exec -- ./test.sh
OK

Note

Keeps the original working directory after first-time install and simplifies localized project_dir detection, removing MISE_BOOTSTRAP_PROJECT_DIR usage.

  • Bootstrap script generation:
    • Restore original working directory after inline install by saving $PWD and cd-ing back.
    • Simplify project_dir resolution in localized mode using the script path (${BASH_SOURCE[0]}) and cd ...
    • Remove MISE_BOOTSTRAP_PROJECT_DIR and related directory switching; keep localized env exports and MISE_INSTALL_PATH setup intact.

Written by Cursor Bugbot for commit 0046115. This will update automatically on new commits. Configure here.

@jdx
Copy link
Owner

jdx commented Nov 14, 2025

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@jdx jdx merged commit 993c230 into jdx:main Nov 14, 2025
30 checks passed
jdx pushed a commit that referenced this pull request Nov 15, 2025
### 🚀 Features

- **(http)** Add 'format' to http backend by @thejcannon in
[#6957](#6957)

### 🐛 Bug Fixes

- **(bootstrap)** wrong directory on first run by @vmeurisse in
[#6971](#6971)
- **(tasks)** fix nested colons with `mise task edit` by @jdx in
[#6978](#6978)
- Use compatible env flags by @thejcannon in
[#6964](#6964)
- Flush vfox download buffer by @blampe in
[#6969](#6969)

### 📚 Documentation

- `arch()` template is `x64` by @thejcannon in
[#6967](#6967)
- update section headers in getting-started.md by @JunichiroKohari in
[#6980](#6980)

### New Contributors

- @JunichiroKohari made their first contribution in
[#6980](#6980)
- @blampe made their first contribution in
[#6969](#6969)
- @thejcannon made their first contribution in
[#6964](#6964)

## 📦 Aqua Registry Updates

#### New Packages (1)

- [`cirruslabs/cirrus-cli`](https://github.com/cirruslabs/cirrus-cli)

#### Updated Packages (1)

- [`axodotdev/cargo-dist`](https://github.com/axodotdev/cargo-dist)
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