diff --git a/install/lib-primitives.sh b/install/lib-primitives.sh index b4234f4..51c6874 100644 --- a/install/lib-primitives.sh +++ b/install/lib-primitives.sh @@ -40,7 +40,7 @@ remove_shell_primitive() { } copy_rust_primitive() { - local name="$1" crate src dst_root dst + local name="$1" crate src dst_root dst sibling crate="$(primitive_field "$name" crate)" [ -n "$crate" ] || { err "no 'crate' for rust primitive $name"; return 1; } src="$KIT_DIR/_primitives/_rust/$crate" @@ -54,6 +54,15 @@ copy_rust_primitive() { mkdir -p "$dst/tests" cp -rf "$src/tests/"* "$dst/tests/" 2>/dev/null || true fi + # v0.21: kei-artifact and future crates reference sibling data dirs via + # include_str!("../schemas/*.json") etc. Copy known sibling directories + # when present. Whitelist keeps target/, .git/, build artifacts out. + for sibling in schemas assets templates fixtures migrations; do + if [ -d "$src/$sibling" ]; then + mkdir -p "$dst/$sibling" + cp -rf "$src/$sibling/"* "$dst/$sibling/" 2>/dev/null || true + fi + done say " + rust: $name (crate $crate)" }