prvng_core/nulib/provisioning-bootstrap.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

32 lines
1.1 KiB
Text

#!/usr/bin/env nu
# Thin entry for bootstrap command (~94ms vs ~9s through the full dispatcher).
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/bootstrap.nu *
def main [
--workspace (-w): string
--dry-run (-n)
--debug (-x)
]: nothing -> nothing {
if $debug { $env.PROVISIONING_DEBUG = true }
let ws = ($workspace | default "")
if $dry_run {
if ($ws | is-not-empty) { main bootstrap --workspace $ws --dry-run } else { main bootstrap --dry-run }
} else {
if ($ws | is-not-empty) { main bootstrap --workspace $ws } else { main bootstrap }
}
}