Skip to content

Commit

Permalink
fix: revert rust-embed to 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 23, 2022
1 parent 299bf05 commit ea586ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changes/rust-embed-revert.md
@@ -0,0 +1,5 @@
---
"create-tauri-app": "patch"
---

Revert back to `rust-embed` 6.4.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/Cargo.toml
Expand Up @@ -20,4 +20,4 @@ path = "src/main.rs"
anyhow = "1.0"
dialoguer = "0.10.2"
pico-args = "0.5.0"
rust-embed = { version = "6.5", features = [ "compression", "interpolate-folder-path" ] }
rust-embed = { version = "6.4", features = [ "compression", "interpolate-folder-path" ] }
15 changes: 5 additions & 10 deletions packages/cli/src/template.rs
Expand Up @@ -120,11 +120,6 @@ impl<'a> Template {
let manifest = Manifest::parse(&manifest_str)?;

let write_file = |file: &str| -> anyhow::Result<()> {
let fragment_file = Fragments::get(file).unwrap();
if fragment_file.metadata.is_dir() {
return Ok(());
}

let manifest = manifest.clone();

// remove the first component, which is certainly the fragment directory they were in before getting embeded into the binary
Expand Down Expand Up @@ -159,7 +154,7 @@ impl<'a> Template {
_ => &file_name,
};

let mut data = fragment_file.data.to_vec();
let mut data = Fragments::get(file).unwrap().data.to_vec();

// Only modify specific set of files
if [
Expand Down Expand Up @@ -211,8 +206,8 @@ impl<'a> Template {
path::PathBuf::from(e.to_string())
.components()
.next()
.map(|c| c.as_os_str())
.unwrap_or_default()
.unwrap()
.as_os_str()
== "base"
}) {
write_file(&file)?;
Expand All @@ -223,8 +218,8 @@ impl<'a> Template {
path::PathBuf::from(e.to_string())
.components()
.next()
.map(|c| c.as_os_str())
.unwrap_or_default()
.unwrap()
.as_os_str()
== path::PathBuf::from(format!("fragment-{}", self))
}) {
write_file(&file)?;
Expand Down

0 comments on commit ea586ca

Please sign in to comment.