mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
fix(watch): don't panic if there's no path provided (#26972)
Closes https://github.com/denoland/deno/issues/26970
This commit is contained in:
parent
5f787957b1
commit
984a87fad5
1 changed files with 5 additions and 3 deletions
|
@ -185,9 +185,11 @@ impl WatcherCommunicator {
|
|||
|
||||
pub fn show_path_changed(&self, changed_paths: Option<Vec<PathBuf>>) {
|
||||
if let Some(paths) = changed_paths {
|
||||
self.print(
|
||||
format!("Restarting! File change detected: {:?}", paths[0]).to_string(),
|
||||
)
|
||||
if !paths.is_empty() {
|
||||
self.print(format!("Restarting! File change detected: {:?}", paths[0]))
|
||||
} else {
|
||||
self.print("Restarting! File change detected.".to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue