-
Notifications
You must be signed in to change notification settings - Fork 260
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
poc: Enable volta uninstall [email protected]
#1658
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,7 +1,6 @@ | ||||||||||||
use volta_core::error::{ExitCode, Fallible}; | ||||||||||||
use volta_core::session::{ActivityKind, Session}; | ||||||||||||
use volta_core::tool; | ||||||||||||
use volta_core::version::VersionSpec; | ||||||||||||
|
||||||||||||
use crate::command::Command; | ||||||||||||
|
||||||||||||
|
@@ -15,10 +14,8 @@ impl Command for Uninstall { | |||||||||||
fn run(self, session: &mut Session) -> Fallible<ExitCode> { | ||||||||||||
session.add_event_start(ActivityKind::Uninstall); | ||||||||||||
|
||||||||||||
let version = VersionSpec::default(); | ||||||||||||
let tool = tool::Spec::from_str_and_version(&self.tool, version); | ||||||||||||
|
||||||||||||
tool.uninstall()?; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This volta/crates/volta-core/src/tool/mod.rs Lines 120 to 124 in 1776387
What I want to do now is to perform an uninstall with a specified version like But I'm not sure that I can replace |
||||||||||||
let tool = tool::Spec::try_from_str(&self.tool)?; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about for tool in Spec::from_strings(&self.tools, "uninstall")? {
tool.resolve(session)?.uninstall(session)?;
} just the same way as install which enable to install/uninstall multiple node/package once. |
||||||||||||
tool.resolve(session)?.uninstall(session)?; | ||||||||||||
|
||||||||||||
session.add_event_end(ActivityKind::Uninstall, ExitCode::Success); | ||||||||||||
Ok(ExitCode::Success) | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe remove node-version.tar.gz in home.tmp_dir is also needed