-
Notifications
You must be signed in to change notification settings - Fork 277
Allow to deactivate environments activated from pixi shell-hook
#3589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Hofer-Julian! I would love to contribute to this. Should I start by writing an async function like |
Please open a separate issue for that @YuanfengZhang |
@mrswastik-robot sounds good to me. Happy to look at a draft PR as soon as you have something :) |
Hi @Hofer-Julian, so I was trying to implement this, but I was having trouble finding the code @wolfv mentioned here in For ex. I wrote this function but there isn't any async fn generate_deactivation_script(
shell: Option<ShellEnum>,
environment: &Environment<'_>,
project: &Workspace,
) -> miette::Result<String> {
let shell = shell.unwrap_or_else(|| {
ShellEnum::from_parent_process()
.unwrap_or_else(|| ShellEnum::from_env().unwrap_or_default())
});
let activator = get_activator(environment, shell.clone()).into_diagnostic()?;
let result = activator.deactivation().into_diagnostic()?;
let script = result.script.contents().into_diagnostic()?;
Ok(script.to_string())
} |
Hey @mrswastik-robot - you are correct. There is some code missing to make it easy to deactivate environments that we need to add to Would you be able to write the |
sure @wolfv, I will give this a try and raise a PR in the rattler repo and link to this issue |
Hi @wolfv, so I have created the PRs, after making changes in the |
Currently, there's no way to deactivate an environment activated by
pixi shell-hook
. Let's implement that!Also see discussion in #3525
The text was updated successfully, but these errors were encountered: