prvng_core/nulib/provisioning-status.nu
Jesús Pérez 316622a78f
merge(refactor/lazy-loading): ADR-025 lazy-loading complete
557 files merged. Conflicts resolved:
  - CHANGELOG.md: took refactor/lazy-loading (session changelog)
  - versions.ncl: took refactor/lazy-loading (adds typedialog entries)
2026-04-17 23:09:56 +01:00

40 lines
1.2 KiB
Text

#!/usr/bin/env nu
# Thin entry for status | health | diagnostics commands.
# Loads ONLY diagnostics modules (~100ms vs ~9s for the full entry).
export-env {
let lib_dirs_raw = ($env.NU_LIB_DIRS? | default "")
let current_lib_dirs = if ($lib_dirs_raw | type) == "string" {
if ($lib_dirs_raw | is-empty) { [] } else { ($lib_dirs_raw | split row ":") }
} else {
$lib_dirs_raw
}
let dynamic = ($env.PROVISIONING? | default "" | path join "core" "nulib")
$env.NU_LIB_DIRS = ([
"/opt/provisioning/core/nulib"
"/usr/local/provisioning/core/nulib"
] | append $current_lib_dirs | append (if ($dynamic | is-not-empty) { [$dynamic] } else { [] }))
}
use main_provisioning/commands/diagnostics.nu *
use main_provisioning/flags.nu *
def main [
...args: string
--out: string
--debug (-x)
--notitles
]: nothing -> nothing {
if $debug { $env.PROVISIONING_DEBUG = true }
let cmd = ($args | get 0? | default "status")
let ops = ($args | skip 1 | str join " ")
let flags = (parse_common_flags {
debug: $debug
out: ($out | default "")
notitles: $notitles
})
handle_diagnostics_command $cmd $ops $flags
}