files: add content64 for base64 encoded values
This commit is contained in:
@@ -15,6 +15,11 @@ pub async fn files(files: &[crate::File], root: &str) -> Result<()> {
|
||||
use crate::FileKind as K;
|
||||
match &file.kind {
|
||||
K::Content(content) => fs::write(path, content.as_bytes()).await?,
|
||||
K::Content64(content) => {
|
||||
use base64::prelude::{Engine as _, BASE64_STANDARD as B64};
|
||||
let content = B64.decode(content)?;
|
||||
fs::write(path, content).await?
|
||||
}
|
||||
K::Dir(true) => fs::create_dir(path).await?,
|
||||
K::Dir(false) => {} // shouldn't happen, but semantic is to ignore
|
||||
K::Symlink(tgt) => fs::symlink(tgt, path).await?,
|
||||
|
||||
Reference in New Issue
Block a user