Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d04661b
fix unexpected exposed removal
Glatzel Mar 18, 2025
1749820
add comment
Glatzel Mar 18, 2025
03faefa
clippy
Glatzel Mar 18, 2025
a64867f
fix unexpected error message if env is not existed
Glatzel Mar 18, 2025
6edc4ce
Merge branch 'main' into fix-pixi-global-update
Glatzel Mar 18, 2025
282b188
fmt
Glatzel Mar 18, 2025
8dc6c98
Merge branch 'main' into fix-pixi-global-update
Glatzel Mar 18, 2025
d6a6074
initial test
Glatzel Mar 18, 2025
8ac466c
fmt
Glatzel Mar 18, 2025
9631eeb
Merge branch 'main' into fix-pixi-global-update
Hofer-Julian Mar 18, 2025
0593125
fix test binary path
Glatzel Mar 18, 2025
1726a95
revert test binary path to bin
Glatzel Mar 18, 2025
fd2b6b3
add real-world dotnet test
Glatzel Mar 19, 2025
bfdbc68
fix manifest
Glatzel Mar 19, 2025
777b582
fix exposed_mapping_binaries when env is not existed but exposed exists.
Glatzel Mar 19, 2025
4d0902d
revert exposed_mapping_binaries
Glatzel Mar 19, 2025
eb930cc
fix env path
Glatzel Mar 19, 2025
14c245a
fmt
Glatzel Mar 19, 2025
8a5669e
skip test on win as it need admin permission
Glatzel Mar 19, 2025
b1f568c
initial update remove deprecated env
Glatzel Mar 19, 2025
be1075d
add error handling and fmt
Glatzel Mar 19, 2025
bafaffb
add test_update_remove_old_env
Glatzel Mar 19, 2025
81c9174
fix test
Glatzel Mar 19, 2025
38f34dd
fix comment
Glatzel Mar 19, 2025
82a42b0
Check if environment is in sync, instead of installing on failure
Hofer-Julian Mar 19, 2025
4206a04
Simplify environment pruning
Hofer-Julian Mar 19, 2025
39a2bcd
Improve logic and test code and also run on Windows
Hofer-Julian Mar 19, 2025
c40ac52
Remove unneeded test
Hofer-Julian Mar 19, 2025
7eb32e9
Remove exitcode success
Hofer-Julian Mar 19, 2025
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
9 changes: 8 additions & 1 deletion src/cli/global/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ pub async fn execute(args: Args) -> miette::Result<()> {
project: &mut Project,
) -> miette::Result<StateChanges> {
// See what executables were installed prior to update
let env_binaries = project.executables_of_direct_dependencies(env_name).await?;
let env_binaries = match project.executables_of_direct_dependencies(env_name).await {
Ok(env_binaries) => env_binaries,
// try to install env if env is not existed.
Err(_) => {
let _ = project.install_environment(env_name).await?;
project.executables_of_direct_dependencies(env_name).await?
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like it might resolve the error I'm seeing in:

@Glatzel Glatzel Mar 18, 2025

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.

looks your issue is the subset of mine in #3366. I think this pr will fix it. I think pixi actually install the global tool, but it also throws a unneeded error message.

};

// Get the exposed binaries from mapping
let exposed_mapping_binaries = &project
Expand Down
8 changes: 7 additions & 1 deletion src/global/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,14 @@ impl Project {
.iter()
.filter_map(|mapping| {
// If the executable isn't requested, remove the mapping
// Use file name of executable relname here for custom exposed path.
// `exposed = {dotnet = 'dotnet\dotnet' }`, file_name will be `dotnet`, eg.
if execs_all.iter().all(|executable| {
executable_from_path(&executable.path) != mapping.executable_relname()
executable_from_path(&executable.path)
!= PathBuf::from(mapping.executable_relname())
.file_name()
.unwrap_or(OsStr::new(""))
.to_string_lossy()
}) {
Some(mapping.exposed_name().clone())
} else {
Expand Down