diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-03-09 14:17:34 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-03-09 14:17:34 +0100 |
| commit | 172f4c8807d44ebe38c7f227b7fdc2d6a9dbe323 (patch) | |
| tree | b880761cf254fbc668cea0d577d5331a28af67cc /src/command/add_remote.rs | |
| parent | 36a4680d18de012e2e5c732f9db161dafa884344 (diff) | |
Allow sync up and down
Diffstat (limited to 'src/command/add_remote.rs')
| -rw-r--r-- | src/command/add_remote.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/command/add_remote.rs b/src/command/add_remote.rs index ad7be83..040e572 100644 --- a/src/command/add_remote.rs +++ b/src/command/add_remote.rs @@ -1,6 +1,6 @@ -use std::fs::{create_dir_all, write}; use std::io::Result; use crate::configuration::Configuration; +use crate::remote::add; pub struct AddRemote; @@ -16,10 +16,8 @@ impl super::Command for AddRemote { } fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> { - create_dir_all(&configuration.config_directory)?; let input = input.expect("You must provide a location for the remote."); - write(&configuration.remote_config, input)?; - return Ok(()) + add(&configuration.config_directory, &configuration.remote_config, input) } fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> { |