42 lines
1.7 KiB
Text
42 lines
1.7 KiB
Text
#!/usr/bin/env nu
|
|
# Thin entry for delete commands (server, taskserv, cluster).
|
|
# Loads only main_provisioning/delete.nu (~45ms vs ~3s for cli.nu fallback).
|
|
|
|
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 { [] }))
|
|
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_debug = ($env.PROVISIONING_DEBUG? | default "")
|
|
if ($raw_debug | describe) == "string" and ($raw_debug | is-not-empty) {
|
|
$env.PROVISIONING_DEBUG = (do $_coerce $raw_debug)
|
|
}
|
|
}
|
|
|
|
use main_provisioning/delete.nu *
|
|
|
|
def main [
|
|
...args: string
|
|
--infra (-i): string = ""
|
|
--yes (-y)
|
|
--debug (-x)
|
|
--keepstorage
|
|
--notitles
|
|
--wait (-w)
|
|
--settings (-s): string = ""
|
|
]: nothing -> nothing {
|
|
if $debug { $env.PROVISIONING_DEBUG = true }
|
|
let target = ($args | get 0? | default "")
|
|
let name = ($args | get 1? | default "")
|
|
main delete $target $name --infra $infra --yes=$yes --keepstorage=$keepstorage --notitles=$notitles --wait=$wait --settings $settings
|
|
}
|