rename scripts and fix collections location
This commit is contained in:
@@ -25,8 +25,12 @@ function Ask-YesNo($message) {
|
||||
}
|
||||
|
||||
# Funzione per chiedere un valore
|
||||
function Ask-Value($key) {
|
||||
return Read-Host "Valore per '$key' (digita `"`" per inserire stringa vuota e lascia vuoto per NON aggiornare)"
|
||||
function Ask-Value($key, $currentValue) {
|
||||
$currentValueHint = ""
|
||||
if (-not [string]::IsNullOrEmpty($currentValue)) {
|
||||
$currentValueHint = "[attuale: '$currentValue'] "
|
||||
}
|
||||
return Read-Host "Chiave '$key' $currentValueHint`n(digita `"`" per inserire stringa vuota e lascia vuoto per NON aggiornare)"
|
||||
}
|
||||
|
||||
# Copia profonda preservando ordine
|
||||
@@ -79,8 +83,6 @@ foreach ($topKey in $parsedJson.Keys) {
|
||||
continue
|
||||
}
|
||||
|
||||
$inputValue = Ask-Value $key
|
||||
|
||||
if ($existingEnv -and $existingEnv["API"] -and $existingEnv["API"].Contains($sectionName)) {
|
||||
$oldValue = $existingEnv["API"][$sectionName][$key]
|
||||
}
|
||||
@@ -88,6 +90,8 @@ foreach ($topKey in $parsedJson.Keys) {
|
||||
$oldValue = ""
|
||||
}
|
||||
|
||||
$inputValue = Ask-Value $key $oldValue
|
||||
|
||||
if ($inputValue -eq "") {
|
||||
# Mantieni valore esistente se presente
|
||||
$newSection[$key] = $oldValue
|
||||
|
||||
Reference in New Issue
Block a user