mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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
aa0ba6580e
commit
bfa9230d3b
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