(source: &Path, sql_name: &str, destination: &Path)
| 8651 | } |
| 8652 | |
| 8653 | fn copy_extension_sql_files(source: &Path, sql_name: &str, destination: &Path) -> Result<bool> { |
| 8654 | if !source.is_dir() { |
| 8655 | return Ok(false); |
| 8656 | } |
| 8657 | let mut copied = false; |
| 8658 | for entry in sorted_children(source)? { |
| 8659 | if !entry.is_file() { |
| 8660 | continue; |
| 8661 | } |
| 8662 | let Some(name) = entry.file_name().and_then(|name| name.to_str()) else { |
| 8663 | continue; |
| 8664 | }; |
| 8665 | if (name.starts_with(&format!("{sql_name}--")) || name == format!("{sql_name}.sql")) |
| 8666 | && name.ends_with(".sql") |
| 8667 | { |
| 8668 | copy_file(&entry, &destination.join(name))?; |
| 8669 | copied = true; |
| 8670 | } |
| 8671 | } |
| 8672 | Ok(copied) |
| 8673 | } |
| 8674 | |
| 8675 | fn copy_extension_sql_dir(source: &Path, destination: &Path) -> Result<bool> { |
| 8676 | if !source.is_dir() { |
no test coverage detected