10 utils/* + workspace/migrate_to_kcl + mode/* files. Selective imports: utils/imports.nu accessor/functions [get-providers-path get-prov-lib-path get-core-nulib-path] utils/logging.nu accessor/core [config-get] utils/generate.nu accessor/functions [2 symbols] utils/files.nu accessor/core [config-get] + secrets/lib [decode_secret_file] utils/qr.nu accessor/functions [get-provisioning-url] utils/undefined.nu interface + init (kept); accessor DEAD utils/interface.nu accessor/core [config-get] + accessor/functions [get-provisioning-url] + logging [is-debug-enabled] Dead imports dropped: workspace/migrate_to_kcl.nu config/accessor mode/commands.nu utils/logging mode/validator.nu utils/logging Validation: all 10 match pre-existing baselines (25/50/42/2 for noisy files, 0 for the others). No new errors. Refs: ADR-025
25 lines
800 B
Text
25 lines
800 B
Text
# Selective imports (ADR-025 Phase 3 Layer 2).
|
|
use lib_provisioning/config/accessor/functions.nu [get-provisioning-url]
|
|
|
|
# Display QR code for URL using qr_maker plugin or fallback
|
|
def show_qr [url: string]: nothing -> nothing {
|
|
let has_qr_plugin = ((version).installed_plugins | str contains "qr_maker")
|
|
|
|
if $has_qr_plugin {
|
|
print ($url | to qr)
|
|
} else {
|
|
let qr_path = ((get-provisioning-resources) | path join "qrs" | path join ($url | path basename))
|
|
if ($qr_path | path exists) {
|
|
print (open -r $qr_path)
|
|
} else {
|
|
print $"(ansi blue_reverse)($url)(ansi reset)"
|
|
print $"(ansi purple)($url)(ansi reset)"
|
|
}
|
|
}
|
|
}
|
|
|
|
export def "make_qr" [
|
|
url?: string
|
|
] {
|
|
show_qr ($url | default (get-provisioning-url))
|
|
}
|