fix: legacy folder asset (#3264)

This commit is contained in:
Miles Murgaw authored and GitHub committed 2024-12-02 11:34:34 -08:00
1 parent a7806583b2
commit 2c1215c6a4
1 file changed
+4 -3
+4 -3
View File
@@ -38,10 +38,10 @@ pub(crate) fn process_file_to(
Some("jpg" | "jpeg" | "png" | "webp" | "avif") => { Some("jpg" | "jpeg" | "png" | "webp" | "avif") => {
process_image(&ImageAssetOptions::new(), source, output_path)?; process_image(&ImageAssetOptions::new(), source, output_path)?;
} }
None if source.is_dir() => {
process_folder(source, output_path)?;
}
Some(_) | None => { Some(_) | None => {
if source.is_dir() {
process_folder(source, output_path)?;
} else {
let source_file = std::fs::File::open(source)?; let source_file = std::fs::File::open(source)?;
let mut reader = std::io::BufReader::new(source_file); let mut reader = std::io::BufReader::new(source_file);
let output_file = std::fs::File::create(output_path)?; let output_file = std::fs::File::create(output_path)?;
@@ -53,6 +53,7 @@ pub(crate) fn process_file_to(
) )
})?; })?;
} }
}
}, },
AssetOptions::Css(options) => { AssetOptions::Css(options) => {
process_css(options, source, output_path)?; process_css(options, source, output_path)?;