Skip to content

Commit

Permalink
fix(cli.rs): cargo build failed due to cache issue, closes #1543 (#1741)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored May 7, 2021
1 parent f369a9c commit 79feb6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changes/cargo-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.rs": patch
---

Fixes a cargo `target/` cache issue.
27 changes: 6 additions & 21 deletions tooling/cli.rs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ impl Dev {
}
}

let dev_path = config
.lock()
.unwrap()
.as_ref()
.unwrap()
.build
.dev_path
.to_string();
let runner_from_config = config
.lock()
.unwrap()
Expand Down Expand Up @@ -164,19 +156,6 @@ impl Dev {
watcher.watch(tauri_path.join("src"), RecursiveMode::Recursive)?;
watcher.watch(tauri_path.join("Cargo.toml"), RecursiveMode::Recursive)?;
watcher.watch(tauri_path.join("tauri.conf.json"), RecursiveMode::Recursive)?;
if !dev_path.starts_with("http") {
watcher.watch(
config
.lock()
.unwrap()
.as_ref()
.unwrap()
.build
.dev_path
.to_string(),
RecursiveMode::Recursive,
)?;
}

loop {
if let Ok(event) = rx.recv() {
Expand All @@ -200,6 +179,12 @@ impl Dev {
process
.kill()
.with_context(|| "failed to kill app process")?;
// wait for the process to exit
loop {
if let Ok(Some(_)) = process.try_wait() {
break;
}
}
process = self.start_app(&runner, child_wait_rx.clone());
}
}
Expand Down

0 comments on commit 79feb6a

Please sign in to comment.