feat: add ability to actually publish
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-26 13:37:49 +02:00
parent 0a258829f7
commit 5ce33b379e
12 changed files with 487 additions and 4 deletions

View File

@@ -1,7 +1,10 @@
#[derive(Clone, Default)]
pub struct Archive {}
use std::{io::Cursor, path::Path};
use std::{
io::{Bytes, Cursor},
path::Path,
};
use anyhow::Context;
@@ -45,6 +48,17 @@ impl Archive {
Ok(buffer.into())
}
pub async fn unpack_archive(&self, archive: &ArchiveFile, dest: &Path) -> anyhow::Result<()> {
tracing::trace!("unpacking archive: {}", dest.display());
let cursor = Cursor::new(archive.content.clone());
let mut arc = tar::Archive::new(cursor);
arc.unpack(dest)?;
Ok(())
}
}
pub struct ArchiveFile {