Skip to content

Commit

Permalink
Fix for quotes in the user input
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelStsefanovich committed Dec 21, 2021
1 parent 2f8a4c5 commit 80c98db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/generate_module_manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ if (! $skip_manifest_update) {
foreach ($item in $user_input_strings) {
$value = $null
info " ? $item`: " -no_newline
$value = Read-Host
$value = (Read-Host).Replace("'", '"')
if ($value.Trim().Length -gt 0) { $manifest.$item = $value }
}

foreach ($item in $user_input_lists) {
$value = $null
info " ? $item` (comma-separated): " -no_newline
$value = Read-Host
$value = (Read-Host).Replace("'", '"')
if ($value.Trim().Length -gt 0) { $manifest.$item = @($value.Split(',') | % {$_.Trim()}) }
}

Expand Down Expand Up @@ -189,7 +189,7 @@ if (! $skip_manifest_update) {
foreach ($item in $user_update_strings) {
$value = $null
info " ? $item`: " -no_newline
$value = Read-Host
$value = (Read-Host).Replace("'", '"')
if ($value.Trim().Length -gt 0) { $manifest.$item = $value }
}

Expand All @@ -203,6 +203,7 @@ if (! $skip_manifest_update) {
}
$command += " -$key '$($manifest.$key)'"
}
write-host $command -ForegroundColor Magenta
iex $command
info "done" -success
}
Expand Down

0 comments on commit 80c98db

Please sign in to comment.