diff options
| author | diogo464 <[email protected]> | 2022-02-08 09:21:12 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2022-02-08 09:21:12 +0000 |
| commit | 92b05a877eb772985d2f4fc9cd198ca642b69b6a (patch) | |
| tree | 4a2edc173b8809e929e4abc47899ae9c6d956684 /dotup_cli/src/commands/init.rs | |
| parent | 0992c36733f58750da93921041424fd09f0158ed (diff) | |
removed old code
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 | } | ||
