File tree Expand file tree Collapse file tree 4 files changed +20
-18
lines changed
Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,12 @@ Write-Host "4. Configure Dev Proxy and its files as executable (Linux and macOS
1818Write-Host " 5. Configure new version notifications for the beta channel"
1919Write-Host " 6. Add the devproxy-beta directory to your PATH environment variable in `$ PROFILE.CurrentUserAllHosts"
2020Write-Host " "
21- $response = Read-Host " Continue (Y/n)?"
21+ Write-Host " Continue (Y/n)? " - NoNewline
22+ $key = [Console ]::ReadKey($true )
23+ $response = $key.KeyChar
2224
23- if ($response -in @ (' n ' , ' N ' )) {
24- Write-Host " Exiting "
25+ if ($response -notin @ (' Y ' , ' y ' , " `r " )) {
26+ Write-Host " `n Exiting "
2527 exit 1
2628}
2729
Original file line number Diff line number Diff line change @@ -21,17 +21,16 @@ echo ""
2121
2222if [ -t 0 ]; then
2323 # Terminal is interactive, prompt the user
24- read -p " Continue (Y/n)? " -r response
24+ read -p " Continue (Y/n)? " -n1 -r response
25+ if [[ " $response " != " " && " $response " != [yY] && " $response " != $' \n ' ]]; then
26+ echo -e " \nExiting"
27+ exit 1
28+ fi
2529else
2630 # Not interactive
2731 response=' y'
2832fi
2933
30- if [[ " $response " != " " && " $response " != [yY] ]]; then
31- echo -e " \nExiting"
32- exit 1
33- fi
34-
3534if [ -t 0 ]; then
3635 echo -e " \n"
3736fi
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ Write-Host "3. Unzip the release in the devproxy directory"
1717Write-Host " 4. Configure devproxy and its files as executable (Linux and macOS only)"
1818Write-Host " 5. Add the devproxy directory to your PATH environment variable in `$ PROFILE.CurrentUserAllHosts"
1919Write-Host " "
20- $response = Read-Host " Continue (Y/n)?"
20+ Write-Host " Continue (Y/n)? " - NoNewline
21+ $key = [Console ]::ReadKey($true )
22+ $response = $key.KeyChar
2123
22- if ($response -in @ (' n ' , ' N ' )) {
23- Write-Host " Exiting "
24+ if ($response -notin @ (' Y ' , ' y ' , " `r " )) {
25+ Write-Host " `n Exiting "
2426 exit 1
2527}
2628
Original file line number Diff line number Diff line change @@ -20,17 +20,16 @@ echo ""
2020
2121if [ -t 0 ]; then
2222 # Terminal is interactive, prompt the user
23- read -p " Continue (Y/n)? " -r response
23+ read -p " Continue (Y/n)? " -n1 -r response
24+ if [[ " $response " != " " && " $response " != [yY] && " $response " != $' \n ' ]]; then
25+ echo -e " \nExiting"
26+ exit 1
27+ fi
2428else
2529 # Not interactive, set a default response
2630 response=' y'
2731fi
2832
29- if [[ " $response " != " " && " $response " != [yY] ]]; then
30- echo -e " \nExiting"
31- exit 1
32- fi
33-
3433if [ -t 0 ]; then
3534 echo -e " \n"
3635fi
You can’t perform that action at this time.
0 commit comments