Skip to content

Commit

Permalink
[cli] fix add subscommand
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 16, 2023
1 parent 98650b1 commit 095f0a2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/cli/src/cmd/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -31,11 +30,6 @@ pub async fn execute_add(tools: String, ask: bool) -> Result<(), Error> {
false => toml::to_string(&current_config)?,
};

let mut config = Configuration {
packages: current_config.packages,
..Default::default()
};

print_diff(&content, &new_content);

if ask {
Expand All @@ -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)?;
Expand Down

0 comments on commit 095f0a2

Please sign in to comment.