Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cli/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,18 @@ fn run_watch(config: &Config, path: PathBuf) -> Result<()> {
}
}

// Check if path exists and has valid permissions
if !path.exists() {
use anyhow::bail;
bail!("Path does not exist: {}", path.display());
}

// Try to access the directory to check permissions
if let Err(e) = std::fs::read_dir(&path) {
use anyhow::bail;
bail!("Failed to access directory '{}': {}. Check permissions.", path.display(), e);
}

let watcher = FileWatcher::new(config.clone(), path);
watcher.watch()
}
Expand Down
Loading