mirror of
https://github.com/openai/codex.git
synced 2026-04-26 07:35:29 +00:00
Updated system skills bundled with Codex were not correctly replacing the user's skills in their .system folder. - Fix `.codex-system-skills.marker` not updating by hashing embedded system skills recursively (nested dirs + file contents), so updates trigger a reinstall. - Added a build Cargo hook to rerun if there are changes in `src/skills/assets/samples/*`, ensuring embedded skill updates rebuild correctly under caching. - Add a small unit test to ensure nested entries are included in the fingerprint.
28 lines
605 B
Rust
28 lines
605 B
Rust
use std::fs;
|
|
use std::path::Path;
|
|
|
|
fn main() {
|
|
let samples_dir = Path::new("src/skills/assets/samples");
|
|
if !samples_dir.exists() {
|
|
return;
|
|
}
|
|
|
|
println!("cargo:rerun-if-changed={}", samples_dir.display());
|
|
visit_dir(samples_dir);
|
|
}
|
|
|
|
fn visit_dir(dir: &Path) {
|
|
let entries = match fs::read_dir(dir) {
|
|
Ok(entries) => entries,
|
|
Err(_) => return,
|
|
};
|
|
|
|
for entry in entries.flatten() {
|
|
let path = entry.path();
|
|
println!("cargo:rerun-if-changed={}", path.display());
|
|
if path.is_dir() {
|
|
visit_dir(&path);
|
|
}
|
|
}
|
|
}
|