about summary refs log tree commit diff
path: root/src/actions
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-02 21:41:28 +0200
committerMel <einebeere@gmail.com>2021-10-02 21:41:28 +0200
commitdd01bff07e029a12c98cf5aedfdce4d19f4f707c (patch)
treecd94b863380b4aa04218cca6e35bc9207829478f /src/actions
parentcf01169e467f4ac36d2d8b9ce13e7bbc81d46aa5 (diff)
downloadka-dd01bff07e029a12c98cf5aedfdce4d19f4f707c.tar.zst
ka-dd01bff07e029a12c98cf5aedfdce4d19f4f707c.zip
Re-add Ka repository directory creation to Create action.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/create.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/actions/create.rs b/src/actions/create.rs
index c12d416..56d946b 100644
--- a/src/actions/create.rs
+++ b/src/actions/create.rs
@@ -5,13 +5,13 @@ use super::ActionOptions;
 
 pub fn create(command_options: ActionOptions, fs: &impl Fs) -> Result<()> {
     let locations = Locations::from(&command_options);
-    // FIXME: Re-add old repository deletion.
-    // if locations.ka_path.exists() {
-    //     fs::remove_dir_all(locations.ka_path.as_path())?;
-    // }
 
-    // fs::create_dir(&locations.ka_path)?;
-    // fs::create_dir(&locations.ka_files_path)?;
+    if locations.ka_path.exists() {
+        fs.delete_directory(&locations.ka_path)?;
+    }
+
+    fs.create_directory(&locations.ka_path)?;
+    fs.create_directory(&locations.ka_files_path)?;
 
     let mut index_file = fs.create_file(&locations.get_repository_index_path())?;
     let empty_history = RepositoryHistory::default();