Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions e2e/cli/test_doctor
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ assert "PATH="" $(which mise) doctor --json"
mise p add uv
mise use uv
assert_contains "mise doctor" "asdf:uv@"
assert_contains "mise doctor" "self_update_available"
assert_contains "mise doctor -J" "dummy"
assert_contains "mise doctor -J" "self_update_available"
6 changes: 6 additions & 0 deletions src/cli/doctor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::{collections::BTreeMap, sync::Arc};

use crate::backend::backend_type::BackendType;
use crate::build_time::built_info;
use crate::cli::self_update::SelfUpdate;
use crate::cli::version;
use crate::cli::version::VERSION;
use crate::config::{Config, IGNORED_CONFIG_FILES};
Expand Down Expand Up @@ -65,6 +66,10 @@ impl Doctor {
);
data.insert("activated".into(), env::is_activated().into());
data.insert("shims_on_path".into(), shims_on_path().into());
data.insert(
"self_update_available".into(),
SelfUpdate::is_available().into(),
);
if env::is_activated() && shims_on_path() {
self.errors.push("shims are on PATH and mise is also activated. You should only use one of these methods.".to_string());
}
Expand Down Expand Up @@ -174,6 +179,7 @@ impl Doctor {
#[cfg(unix)]
info::inline_section("activated", yn(env::is_activated()))?;
info::inline_section("shims_on_path", yn(shims_on_path()))?;
info::inline_section("self_update_available", yn(SelfUpdate::is_available()))?;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

doesn't seem very valuable here... but I also think we should be consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

doesn't seem very valuable here... but I also think we should be consistent

Yeah I know what you mean.

I can see how the output of mise doctor vs mise doctor --json could be different, if required, but I think "The Principle of Least Surprise" would suggest they should be the same, just a different format.

if env::is_activated() && shims_on_path() {
self.errors.push("shims are on PATH and mise is also activated. You should only use one of these methods.".to_string());
}
Expand Down
Loading