From 095f0a264ed7204853de8f8fb7f6ef1e3bb50c7d Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Fri, 16 Jun 2023 07:02:59 +0000 Subject: [PATCH] [cli] fix `add` subscommand --- crates/cli/src/cmd/add.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/cli/src/cmd/add.rs b/crates/cli/src/cmd/add.rs index 2719b0c..c253c78 100644 --- a/crates/cli/src/cmd/add.rs +++ b/crates/cli/src/cmd/add.rs @@ -2,7 +2,6 @@ use std::fs; use anyhow::Error; use crosup_core::{config::verify_if_config_file_is_present, graph::build_installer_graph}; -use crosup_types::configuration::Configuration; use owo_colors::OwoColorize; use crate::{cmd::print_diff, macros::install, types::InstallArgs}; @@ -31,11 +30,6 @@ pub async fn execute_add(tools: String, ask: bool) -> Result<(), Error> { false => toml::to_string(¤t_config)?, }; - let mut config = Configuration { - packages: current_config.packages, - ..Default::default() - }; - print_diff(&content, &new_content); if ask { @@ -45,7 +39,8 @@ pub async fn execute_add(tools: String, ask: bool) -> Result<(), Error> { let args = InstallArgs { ..Default::default() }; - install!(args, config, None); + + install!(args, current_config, None); if is_present { fs::write(filename, new_content)?;