Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
zipsign.pub binary
crates/mise-shim/native-shim-marker binary
src/gpg_testdata/node_v20.11.0_SHASUMS256.txt text eol=lf
src/system/remote_testdata/* text eol=lf
vendor/aqua-registry/** linguist-vendored
Expand Down
1 change: 1 addition & 0 deletions crates/mise-shim/native-shim-marker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mise generated native shim v1
2 changes: 2 additions & 0 deletions crates/mise-shim/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use std::path::Path;
use std::process::{Command, ExitCode};

const MISE_SHIM_PATH_ENV: &str = "__MISE_SHIM_PATH";
#[used]
static NATIVE_SHIM_MARKER: [u8; 30] = *include_bytes!("../native-shim-marker");

fn paths_eq(a: &Path, b: &Path) -> bool {
let lexical_eq = |a: &Path, b: &Path| {
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/reshim.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Note that this creates shims for _all_ installed tools, not just the ones that a
currently active in mise.toml.

## Flags
- **`-f --force`** — Removes all shims before reshimming
- **`-f --force`** — Rebuilds all mise-owned shims
- **`--system`** — Rebuild the system shim farm
- **`-h --help`** — Print help

Expand Down
5 changes: 4 additions & 1 deletion docs/dev-tools/shims.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ Note that `mise` already runs a reshim anytime a tool is installed/updated/remov
`mise reshim` only creates/removes the shims. Some users sometimes use it as a
"fix it" button, but it is only necessary if `~/.local/share/mise/shims` doesn't contain something it should.

Do not add additional executable in the `mise` directory, `mise` will delete them with the next reshim.
The configured shim directory can safely be a shared executable directory such as `~/.local/bin`
Comment thread
jdx marked this conversation as resolved.
Resolved
or `/usr/local/bin`. `mise reshim` only replaces or removes entries it recognizes as mise shims.
When an unmanaged file has the same name as a desired shim, mise keeps the existing file and prints
a warning.

## Command wrappers

Expand Down
4 changes: 4 additions & 0 deletions docs/directories.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ does not work for some reason.

The setting is global-only, expands `~`, and must resolve to an absolute path.

The shim directory may also be a shared executable directory such as `~/.local/bin` or
`/usr/local/bin`. `mise reshim` only replaces or removes entries it recognizes as mise shims. A
same-named file owned by you or another package manager is preserved.

## System installs and shims

System installs default to `/usr/local/share/mise/installs` and system shims
Expand Down
2 changes: 1 addition & 1 deletion man/man1/mise.1
Original file line number Diff line number Diff line change
Expand Up @@ -4158,7 +4158,7 @@ currently active in mise.toml.
.PP
.TP
\fB\-f, \-\-force\fR
Removes all shims before reshimming
Rebuilds all mise\-owned shims
.TP
\fB\-\-system\fR
Rebuild the system shim farm
Expand Down
2 changes: 1 addition & 1 deletion mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,7 @@ Note that this creates shims for _all_ installed tools, not just the ones that a
currently active in mise.toml.
"""#
after_long_help "\u{1b}[1m\u{1b}[4mExamples:\u{1b}[22m\u{1b}[24m\n\n $ \u{1b}[1mmise reshim\u{1b}[22m\n $ \u{1b}[1m~/.local/share/mise/shims/node -v\u{1b}[22m\n v20.0.0\n"
flag "-f --force" help="Removes all shims before reshimming"
flag "-f --force" help="Rebuilds all mise-owned shims"
flag --system help="Rebuild the system shim farm"
flag "-h --help" help="Print help" action=help builtin=#true
arg "[TOOL]" required=#false hide=#true
Expand Down
2 changes: 2 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2589,6 +2589,8 @@ description = "Directory containing user shims."
docs = """
The user shim farm. Lazy tools declared in user config publish their bootstrap shims here.
The directory must be absolute after `~` expansion.
It may be a shared executable directory such as `~/.local/bin`; mise only replaces or removes
entries it recognizes as mise shims.
"""
env = "MISE_SHIMS_DIR"
global_only = true
Expand Down
2 changes: 1 addition & 1 deletion src/cli/reshim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) struct Reshim {
#[usage(hide = true)]
pub version: Option<String>,

/// Removes all shims before reshimming
/// Rebuilds all mise-owned shims
Comment thread
jdx marked this conversation as resolved.
Resolved
#[usage(long, short)]
pub force: bool,

Expand Down
Loading
Loading