ontoref/reflection/migrations/0001-ontology-infrastructure.ncl

27 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2026-03-29 00:19:56 +00:00
{
id = "0001",
slug = "ontology-infrastructure",
description = "Add manifest.ncl and connections.ncl to .ontology/",
check = {
tag = "NuCmd",
cmd = "if ($\"($env.ONTOREF_PROJECT_ROOT)/.ontology/manifest.ncl\" | path exists) and ($\"($env.ONTOREF_PROJECT_ROOT)/.ontology/connections.ncl\" | path exists) { exit 0 } else { exit 1 }",
expect_exit = 0,
},
instructions = "
1. Source env vars if not already set:
. $(which ontoref) --env-only
2. Copy missing templates (additive — existing files are NOT overwritten):
test -f .ontology/manifest.ncl || sed 's/{{ project_name }}/{project_name}/g' \\
\"$ONTOREF_ROOT/templates/ontology/manifest.ncl\" > .ontology/manifest.ncl
test -f .ontology/connections.ncl || sed 's/{{ project_name }}/{project_name}/g' \\
\"$ONTOREF_ROOT/templates/ontology/connections.ncl\" > .ontology/connections.ncl
3. Validate both export cleanly:
nickel export --import-path \"$NICKEL_IMPORT_PATH\" .ontology/manifest.ncl > /dev/null && echo ok
nickel export --import-path \"$NICKEL_IMPORT_PATH\" .ontology/connections.ncl > /dev/null && echo ok
4. Open manifest.ncl and set repo_kind to the correct value for this project.
",
}