Fix non windows builds.

This commit is contained in:
Mario Carbajal 2024-01-25 18:29:10 -03:00
parent 810d2cb84b
commit 66d9a837d8
1 changed files with 4 additions and 2 deletions

View File

@ -109,13 +109,15 @@ fn normalized_relative_path(base: &Path, subpath: &Path) -> anyhow::Result<Strin
let base = base.canonicalize()?; let base = base.canonicalize()?;
let subpath = subpath.canonicalize()?; let subpath = subpath.canonicalize()?;
let relative_path_str = subpath let relative_path_str: String = subpath
.strip_prefix(base) .strip_prefix(base)
.context("css file should be inside manifest_dir")? .context("css file should be inside manifest_dir")?
.to_string_lossy(); .to_string_lossy()
.into();
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
let relative_path_str = relative_path_str.replace('\\', "/"); let relative_path_str = relative_path_str.replace('\\', "/");
Ok(relative_path_str) Ok(relative_path_str)
} }