MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / copy_extension_sql_files

Function copy_extension_sql_files

xtask/src/main.rs:8653–8673  ·  view source on GitHub ↗
(source: &Path, sql_name: &str, destination: &Path)

Source from the content-addressed store, hash-verified

8651}
8652
8653fn 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
8675fn copy_extension_sql_dir(source: &Path, destination: &Path) -> Result<bool> {
8676 if !source.is_dir() {

Callers 1

Calls 3

sorted_childrenFunction · 0.85
copy_fileFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected