24 lines
863 B
Text
24 lines
863 B
Text
#!/usr/bin/env nu
|
|
use lib/runner.nu [run-reflection-mode, print-summary-and-exit]
|
|
|
|
def main [
|
|
--policy-repos-root: string,
|
|
--schemas-root: string = "",
|
|
--provisioning-root: string = "",
|
|
]: nothing -> nothing {
|
|
if ($policy_repos_root | is-empty) { error make { msg: "--policy-repos-root is required" } }
|
|
|
|
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-keeper-policy.ncl" {
|
|
policy_repos_root: ($policy_repos_root | path expand),
|
|
schemas_root: $schemas,
|
|
} $root
|
|
print-summary-and-exit $results
|
|
}
|