diff --git a/nulib/main_provisioning/dispatcher.nu b/nulib/main_provisioning/dispatcher.nu index 2db2752..9746333 100644 --- a/nulib/main_provisioning/dispatcher.nu +++ b/nulib/main_provisioning/dispatcher.nu @@ -53,7 +53,7 @@ def _dispatch_workspace [cmd: string, ops: string, flags: record] { } def _dispatch_config [cmd: string, ops: string, flags: record] { use commands/configuration.nu * - handle_config_command $cmd $ops $flags + handle_configuration_command $cmd $ops $flags } def _dispatch_utilities [cmd: string, ops: string, flags: record] { use commands/utilities/mod.nu * diff --git a/nulib/provisioning-cli.nu b/nulib/provisioning-cli.nu index c60e32d..280219e 100644 --- a/nulib/provisioning-cli.nu +++ b/nulib/provisioning-cli.nu @@ -31,6 +31,25 @@ export-env { if ( (version).installed_plugins | str contains "tera" ) { (plugin use tera) } + + # Bash exports booleans as strings — normalize before any module code runs. + let _coerce = {|raw| $raw == "true" or $raw == "1" } + let raw_no_titles = ($env.PROVISIONING_NO_TITLES? | default "") + if ($raw_no_titles | describe) == "string" and ($raw_no_titles | is-not-empty) { + $env.PROVISIONING_NO_TITLES = (do $_coerce $raw_no_titles) + } + let raw_no_terminal = ($env.PROVISIONING_NO_TERMINAL? | default "") + if ($raw_no_terminal | describe) == "string" and ($raw_no_terminal | is-not-empty) { + $env.PROVISIONING_NO_TERMINAL = (do $_coerce $raw_no_terminal) + } + let raw_titles_shown = ($env.PROVISIONING_TITLES_SHOWN? | default "") + if ($raw_titles_shown | describe) == "string" and ($raw_titles_shown | is-not-empty) { + $env.PROVISIONING_TITLES_SHOWN = (do $_coerce $raw_titles_shown) + } + let raw_debug = ($env.PROVISIONING_DEBUG? | default "") + if ($raw_debug | describe) == "string" and ($raw_debug | is-not-empty) { + $env.PROVISIONING_DEBUG = (do $_coerce $raw_debug) + } } # ADR-025 Phase 4 perf insight: Nushell selective imports (`use x [sym]`) still @@ -56,7 +75,7 @@ export def "main help" [ if ($out | is-not-empty) { $env.PROVISIONING_NO_TERMINAL = false } let category = if ($args | length) > 0 { ($args | get 0) } else { "" } print (provisioning_options $category) - if not $env.PROVISIONING_DEBUG { end_run "" } + if not ($env.PROVISIONING_DEBUG? | default false) { end_run "" } } def main [ @@ -249,7 +268,7 @@ def main [ "status", "health", "diagnostics", "next", "phase" ]) { dispatch_command $reordered_args $parsed_flags - if not $env.PROVISIONING_DEBUG { end_run "" } + if not ($env.PROVISIONING_DEBUG? | default false) { end_run "" } return }