Skip to content

Commit

Permalink
Remove executable alias; import anstream (#5187)
Browse files Browse the repository at this point in the history
Post-push review from #5160.
  • Loading branch information
charliermarsh authored Jul 18, 2024
1 parent 8484611 commit 36a0ee9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2215,7 +2215,7 @@ pub struct ToolDirArgs {
///
/// By default, `uv tool dir` shows the directory into which the tool Python environments
/// themselves are installed, rather than the directory containing the linked executables.
#[arg(long, alias = "executable")]
#[arg(long)]
pub bin: bool,
}

Expand Down
3 changes: 2 additions & 1 deletion crates/uv/src/commands/cache_dir.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use anstream::println;
use owo_colors::OwoColorize;

use uv_cache::Cache;
use uv_fs::Simplified;

/// Show the cache directory.
pub(crate) fn cache_dir(cache: &Cache) {
anstream::println!("{}", cache.root().simplified_display().cyan());
println!("{}", cache.root().simplified_display().cyan());
}
3 changes: 2 additions & 1 deletion crates/uv/src/commands/python/dir.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use anstream::println;
use anyhow::Context;
use owo_colors::OwoColorize;

Expand All @@ -13,7 +14,7 @@ pub(crate) fn dir(preview: PreviewMode) -> anyhow::Result<()> {
}
let installed_toolchains = ManagedPythonInstallations::from_settings()
.context("Failed to initialize toolchain settings")?;
anstream::println!(
println!(
"{}",
installed_toolchains.root().simplified_display().cyan()
);
Expand Down
5 changes: 3 additions & 2 deletions crates/uv/src/commands/tool/dir.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use anstream::println;
use anyhow::Context;
use owo_colors::OwoColorize;

Expand All @@ -14,11 +15,11 @@ pub(crate) fn dir(bin: bool, preview: PreviewMode) -> anyhow::Result<()> {

if bin {
let executable_directory = find_executable_directory()?;
anstream::println!("{}", executable_directory.simplified_display().cyan());
println!("{}", executable_directory.simplified_display().cyan());
} else {
let installed_tools =
InstalledTools::from_settings().context("Failed to initialize tools settings")?;
anstream::println!("{}", installed_tools.root().simplified_display().cyan());
println!("{}", installed_tools.root().simplified_display().cyan());
}

Ok(())
Expand Down

0 comments on commit 36a0ee9

Please sign in to comment.