This commit is contained in:
Mikaël Cluseau
2026-06-05 11:04:17 +02:00
parent 97c25f6b20
commit 34a77eb436
3 changed files with 5 additions and 9 deletions
+2 -6
View File
@@ -25,7 +25,7 @@ pub async fn file(file: &File, root: &str, dry_run: bool) -> Result<()> {
let kind = file.kind();
let content = kind.content()?;
use crate::{FileKind as K};
use crate::FileKind as K;
match kind.as_ref() {
K::Skip => {
info!("{}: kind is skip", file.path);
@@ -34,11 +34,7 @@ pub async fn file(file: &File, root: &str, dry_run: bool) -> Result<()> {
K::Content(_) | K::Content64(_) | K::Parts(_) => {
let content = content.expect("this file kind should have content");
if dry_run {
info!(
"would create {} ({} bytes)",
file.path,
content.len()
);
info!("would create {} ({} bytes)", file.path, content.len());
} else {
fs::write(path, &content).await?;
}
+2 -2
View File
@@ -111,12 +111,12 @@ impl Config {
}
pub fn base64_decode(s: &str) -> Result<Vec<u8>, base64::DecodeError> {
use base64::{prelude::BASE64_STANDARD_NO_PAD as B64, Engine as _};
use base64::{Engine as _, prelude::BASE64_STANDARD_NO_PAD as B64};
B64.decode(s.trim_end_matches('='))
}
pub fn base64_encode(b: &[u8]) -> String {
use base64::{prelude::BASE64_STANDARD as B64, Engine as _};
use base64::{Engine as _, prelude::BASE64_STANDARD as B64};
B64.encode(b)
}
+1 -1
View File
@@ -117,7 +117,7 @@ where
std::process::exit(0);
}
Err(e) => {
eprint!("{e}");
eprintln!("{e}");
std::process::exit(1);
}
}