Skip to content

fix: Add an early check, before creating directories for <non-existent-env> while uninstalling them#4049

Merged
nichmor merged 2 commits intoprefix-dev:mainfrom
mrswastik-robot:pixi-global-uninstall-empty-dir
Jul 2, 2025
Merged

fix: Add an early check, before creating directories for <non-existent-env> while uninstalling them#4049
nichmor merged 2 commits intoprefix-dev:mainfrom
mrswastik-robot:pixi-global-uninstall-empty-dir

Conversation

@mrswastik-robot
Copy link
Contributor

@mrswastik-robot mrswastik-robot commented Jun 29, 2025

fixes #4032

From what I could understand, while uninstalling the env, the directory was always being created because of the tokio_fs::create_dir_all(&path).await call from remove_environment() in src/global/project/mod.rs

So just added a check before that. I checked it locally by building the pixi and it works. hope this fixes the issue:)

@Hofer-Julian Hofer-Julian requested a review from nichmor June 30, 2025 07:21
@nichmor
Copy link
Contributor

nichmor commented Jul 2, 2025

tested with

cargo run -- global uninstall example-dir

Works as expected!

@nichmor nichmor merged commit 2258cd1 into prefix-dev:main Jul 2, 2025
38 checks passed
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.

pixi global uninstall <non-existent-env> creates an empty directory

3 participants