Add recommendation if error with root prefix (#3513)

Add recommendation if error
This commit is contained in:
Hind-M 2024-10-07 19:43:03 +02:00 committed by GitHub
parent c4068d3117
commit 215e5e522a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -658,7 +658,12 @@ namespace mamba
&& !fs::exists(prefix / "envs"))
{
return make_unexpected(
fmt::format(R"(Path "{}" is not an existing root prefix.)", prefix.string()),
fmt::format(
R"(Path "{}" is not an existing root prefix.)"
R"( Please set explicitly `MAMBA_ROOT_PREFIX` to "{}" to skip this error.)",
prefix.string(),
prefix.string()
),
mamba_error_code::incorrect_usage
);
}
@ -688,7 +693,9 @@ namespace mamba
return make_unexpected(
fmt::format(
R"(Could not use default root_prefix "{}":)"
R"( Directory exists, is not empty and not a conda prefix.)",
R"( Directory exists, is not empty and not a conda prefix.)"
R"( Please set explicitly `MAMBA_ROOT_PREFIX` to "{}" to skip this error.)",
prefix.string(),
prefix.string()
),
mamba_error_code::incorrect_usage