Skip to content

Update Linux setup scripts to allow Enter key as default confirmation (Y) #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/setup-beta.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ Write-Host "4. Configure Dev Proxy and its files as executable (Linux and macOS
Write-Host "5. Configure new version notifications for the beta channel"
Write-Host "6. Add the devproxy-beta directory to your PATH environment variable in `$PROFILE.CurrentUserAllHosts"
Write-Host ""
Write-Host "Continue (y/n)? " -NoNewline
$response = [System.Console]::ReadKey().KeyChar
Write-Host "Continue (Y/n)? " -NoNewline
$key = [Console]::ReadKey($true)
$response = $key.KeyChar

if ($response -notin @('y', 'Y')) {
if ($response -notin @('Y', 'y', "`r")) {
Write-Host "`nExiting"
exit 1
}
Expand Down
11 changes: 5 additions & 6 deletions scripts/setup-beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ echo ""

if [ -t 0 ]; then
# Terminal is interactive, prompt the user
read -p "Continue (y/n)? " -n1 -r response
read -p "Continue (Y/n)? " -n1 -r response
if [[ "$response" != "" && "$response" != [yY] && "$response" != $'\n' ]]; then
echo -e "\nExiting"
exit 1
fi
else
# Not interactive
response='y'
fi

if [[ "$response" != [yY] ]]; then
echo -e "\nExiting"
exit 1
fi

if [ -t 0 ]; then
echo -e "\n"
fi
Expand Down
7 changes: 4 additions & 3 deletions scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Write-Host "3. Unzip the release in the devproxy directory"
Write-Host "4. Configure devproxy and its files as executable (Linux and macOS only)"
Write-Host "5. Add the devproxy directory to your PATH environment variable in `$PROFILE.CurrentUserAllHosts"
Write-Host ""
Write-Host "Continue (y/n)? " -NoNewline
$response = [System.Console]::ReadKey().KeyChar
Write-Host "Continue (Y/n)? " -NoNewline
$key = [Console]::ReadKey($true)
$response = $key.KeyChar

if ($response -notin @('y', 'Y')) {
if ($response -notin @('Y', 'y', "`r")) {
Write-Host "`nExiting"
exit 1
}
Expand Down
11 changes: 5 additions & 6 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ echo ""

if [ -t 0 ]; then
# Terminal is interactive, prompt the user
read -p "Continue (y/n)? " -n1 -r response
read -p "Continue (Y/n)? " -n1 -r response
if [[ "$response" != "" && "$response" != [yY] && "$response" != $'\n' ]]; then
echo -e "\nExiting"
exit 1
fi
else
# Not interactive, set a default response
response='y'
fi

if [[ "$response" != [yY] ]]; then
echo -e "\nExiting"
exit 1
fi

if [ -t 0 ]; then
echo -e "\n"
fi
Expand Down