feat(cli/uninstall): add uninstall command (#12209)

This commit is contained in:
Sylvain Cau 2021-09-30 23:38:07 +08:00 committed by GitHub
parent f602d63f48
commit ee2e25fba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 145 additions and 0 deletions

View file

@ -53,6 +53,7 @@ use crate::flags::LintFlags;
use crate::flags::ReplFlags;
use crate::flags::RunFlags;
use crate::flags::TestFlags;
use crate::flags::UninstallFlags;
use crate::flags::UpgradeFlags;
use crate::fmt_errors::PrettyJsError;
use crate::module_loader::CliModuleLoader;
@ -487,6 +488,12 @@ async fn install_command(
)
}
async fn uninstall_command(
uninstall_flags: UninstallFlags,
) -> Result<(), AnyError> {
tools::installer::uninstall(uninstall_flags.name, uninstall_flags.root)
}
async fn lsp_command() -> Result<(), AnyError> {
lsp::start().await
}
@ -1149,6 +1156,9 @@ fn get_subcommand(
DenoSubcommand::Install(install_flags) => {
install_command(flags, install_flags).boxed_local()
}
DenoSubcommand::Uninstall(uninstall_flags) => {
uninstall_command(uninstall_flags).boxed_local()
}
DenoSubcommand::Lsp => lsp_command().boxed_local(),
DenoSubcommand::Lint(lint_flags) => {
lint_command(flags, lint_flags).boxed_local()