1 use std::fs::{create_dir_all, write};
3 use crate::configuration::Configuration;
13 impl super::Command for AddRemote {
14 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
18 fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
19 create_dir_all(&configuration.config_directory)?;
20 let input = input.expect("You must provide a location for the remote.");
21 write(&configuration.remote_config, input)?;
25 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
29 fn command(&self) -> &'static str {
33 fn help(&self) -> &'static str {
34 "<git_url>\t\tAdds or updates a git remote to sync with"