This commit is contained in:
2026-05-09 18:07:24 -05:00
parent 60f037d20d
commit d6b816d273
6 changed files with 48 additions and 2 deletions
+16
View File
@@ -90,6 +90,22 @@ The `validate` method should take `&self` and return `Result<(), DrawerError>`.
creating a `DrawerOperation` and not using it, also call `validate` and print out the error if there is one. This means
we also need to `impl Display` on `DrawerError`.
### Phase 3
For phase 3 we want to start implementing the `close` command. We'll get the tar part working but not worry about encryption yet.
- Make a new method `perform` on `DrawerOperation` which takes `&self` and returns `Result<(), DrawerError>`.
- `perform` should first call `validate` and return the error if there is one.
- After that, it should call either `open(&self)` or `close(&self)` depending on the operation type. For now, `open` will just be a `todo!()`
- The new `close` method should create a vec<u8> consisting of the contents of the target directory as a tarball (use the tar create we depend on)
- After creating the vec, it should write it out to the drawer file path.
I'm going to add some test data to the project under `tests/` but it's just random data to test, ignore the contents of all those files.
### Phase 3a
As a minor improvement, make the `perform_close` method also gzip the contents of the tarball.
## Commands
```bash