diff options
Diffstat (limited to 'dotup_cli/src/commands/init.rs')
| -rw-r--r-- | dotup_cli/src/commands/init.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/dotup_cli/src/commands/init.rs b/dotup_cli/src/commands/init.rs deleted file mode 100644 index 45129bf..0000000 --- a/dotup_cli/src/commands/init.rs +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | use super::prelude::*; | ||
| 2 | |||
| 3 | /// Creates an empty depot file if one doesnt already exist. | ||
| 4 | /// | ||
| 5 | /// By default this will create the file in the current directory | ||
| 6 | /// but the --depot flag can be used to change this path. | ||
| 7 | #[derive(Parser)] | ||
| 8 | pub struct Opts {} | ||
| 9 | |||
| 10 | pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { | ||
| 11 | if !dotup::utils::is_file(&config.archive_path)? { | ||
| 12 | let archive = Archive::default(); | ||
| 13 | log::info!("Creating archive at {}", &config.archive_path.display()); | ||
| 14 | utils::write_archive(&config.archive_path, &archive)?; | ||
| 15 | } else { | ||
| 16 | log::warn!( | ||
| 17 | "Archive file already exists : '{}'", | ||
| 18 | config.archive_path.display() | ||
| 19 | ); | ||
| 20 | } | ||
| 21 | Ok(()) | ||
| 22 | } | ||
