provisioning/reflection/handlers/validate-playbooks.nu

22 lines
699 B
Text
Raw Normal View History

2026-05-12 02:40:14 +01:00
#!/usr/bin/env nu
use lib/runner.nu [run-reflection-mode, print-summary-and-exit]
def main [
--provisioning-root: string = "",
--schemas-root: string = "",
]: nothing -> nothing {
let root = if not ($provisioning_root | is-empty) {
$provisioning_root
} else {
$env | get -o PROVISIONING_ROOT | default ($env.FILE_PWD | path join ".." | path expand)
}
let schemas = if not ($schemas_root | is-empty) { $schemas_root } else { $"($root)/schemas/lib" }
let results = run-reflection-mode $"($root)/reflection/modes/validate-playbooks.ncl" {
provisioning_root: $root,
schemas_root: $schemas,
} $root
print-summary-and-exit $results
}