mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
fix(setup): make sure selections are numbers
This commit is contained in:
committed by
Pete Johanson
parent
3e65f6d472
commit
da08b4852d
4
docs/static/setup.ps1
vendored
4
docs/static/setup.ps1
vendored
@@ -16,13 +16,13 @@ function Get-Choice-From-Options {
|
||||
}
|
||||
|
||||
Write-Host "$($Options.length + 1)) Quit"
|
||||
$selection = Read-Host $Prompt
|
||||
$selection = (Read-Host $Prompt) -as [int]
|
||||
|
||||
if ($selection -eq $Options.length + 1) {
|
||||
Write-Host "Goodbye!"
|
||||
exit 1
|
||||
}
|
||||
elseif ($selection -le $Options.length) {
|
||||
elseif ($selection -le $Options.length -and $selection -gt 0) {
|
||||
$choice = $($selection - 1)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user