Skip to content

Commit 9076d5d

Browse files
Tnzelucasfernog
andauthored
feat(cli): add prompt information when file changing detected, closes #5417 (#5428)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
1 parent ef41c5b commit 9076d5d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.changes/cli-watcher-info.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Log dev watcher file change detection.

tooling/cli/src/interface/rust.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use tauri_bundler::{
3333

3434
use super::{AppSettings, ExitReason, Interface};
3535
use crate::helpers::{
36-
app_paths::tauri_dir,
36+
app_paths::{app_dir, tauri_dir},
3737
config::{reload as reload_config, wix_settings, Config},
3838
};
3939

@@ -342,6 +342,7 @@ impl Rust {
342342
) -> crate::Result<()> {
343343
let process = Arc::new(Mutex::new(child));
344344
let (tx, rx) = sync_channel(1);
345+
let app_path = app_dir();
345346
let tauri_path = tauri_dir();
346347
let workspace_path = get_workspace_dir()?;
347348

@@ -393,10 +394,18 @@ impl Rust {
393394
let event_path = event.path;
394395

395396
if event_path.file_name() == Some(OsStr::new("tauri.conf.json")) {
397+
info!("Tauri configuration changed. Rewriting manifest...");
396398
let config = reload_config(options.config.as_deref())?;
397399
self.app_settings.manifest =
398400
rewrite_manifest(config.lock().unwrap().as_ref().unwrap())?;
399401
} else {
402+
info!(
403+
"File {} changed. Rebuilding application...",
404+
event_path
405+
.strip_prefix(&app_path)
406+
.unwrap_or(&event_path)
407+
.display()
408+
);
400409
// When tauri.conf.json is changed, rewrite_manifest will be called
401410
// which will trigger the watcher again
402411
// So the app should only be started when a file other than tauri.conf.json is changed

0 commit comments

Comments
 (0)