do special token replacement in all .sql files that we copy
@@ -82,9 +82,15 @@ fn copy_file(src: PathBuf, dest: PathBuf, msg: &str) {
format_display_path(&dest)
);
+ // we want to filter the contents of each sql file
+ let mut input = handle_result!(
+ std::fs::read_to_string($src), format!("failed to read `{}`", src.display())
+ );
+ let input = filter_contents(input);
+
handle_result!(
- std::fs::copy(&src, &dest),
- format!("failed copying `{}` to `{}`", src.display(), dest.display())
+ std::fs::write(&src, &input),
+ format!("failed writing `{}` to `{}`", src.display(), dest.display())
);
}
