True when `path` is a readable UTF-8 text file. Used to fail the skill bundle codegen early with a clear message when a binary support file would otherwise break `include_str!` with an opaque compile error.
(path: &Path)
| 343 | /// bundle codegen early with a clear message when a binary support file would |
| 344 | /// otherwise break `include_str!` with an opaque compile error. |
| 345 | fn is_probably_utf8_text(path: &Path) -> bool { |
| 346 | match fs::read(path) { |
| 347 | Ok(bytes) => std::str::from_utf8(&bytes).is_ok(), |
| 348 | // Unreadable files fall through to include_str!'s own error. |
| 349 | Err(_) => true, |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | /// Generates `$OUT_DIR/plugin_bundle_generated.rs`: a recursive manifest of |
| 354 | /// every file under `plugin/skills/` (SKILL.md *and* any `references/`, |
no test coverage detected