mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
6
.changes/cli-watcher-info.md
Normal file
6
.changes/cli-watcher-info.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": patch
|
||||
"cli.js": patch
|
||||
---
|
||||
|
||||
Log dev watcher file change detection.
|
||||
@@ -33,7 +33,7 @@ use tauri_bundler::{
|
||||
|
||||
use super::{AppSettings, ExitReason, Interface};
|
||||
use crate::helpers::{
|
||||
app_paths::tauri_dir,
|
||||
app_paths::{app_dir, tauri_dir},
|
||||
config::{reload as reload_config, wix_settings, Config},
|
||||
};
|
||||
|
||||
@@ -342,6 +342,7 @@ impl Rust {
|
||||
) -> crate::Result<()> {
|
||||
let process = Arc::new(Mutex::new(child));
|
||||
let (tx, rx) = sync_channel(1);
|
||||
let app_path = app_dir();
|
||||
let tauri_path = tauri_dir();
|
||||
let workspace_path = get_workspace_dir()?;
|
||||
|
||||
@@ -393,10 +394,18 @@ impl Rust {
|
||||
let event_path = event.path;
|
||||
|
||||
if event_path.file_name() == Some(OsStr::new("tauri.conf.json")) {
|
||||
info!("Tauri configuration changed. Rewriting manifest...");
|
||||
let config = reload_config(options.config.as_deref())?;
|
||||
self.app_settings.manifest =
|
||||
rewrite_manifest(config.lock().unwrap().as_ref().unwrap())?;
|
||||
} else {
|
||||
info!(
|
||||
"File {} changed. Rebuilding application...",
|
||||
event_path
|
||||
.strip_prefix(&app_path)
|
||||
.unwrap_or(&event_path)
|
||||
.display()
|
||||
);
|
||||
// When tauri.conf.json is changed, rewrite_manifest will be called
|
||||
// which will trigger the watcher again
|
||||
// So the app should only be started when a file other than tauri.conf.json is changed
|
||||
|
||||
Reference in New Issue
Block a user