feat: add ability to actually publish
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user