sh-elf-vhex - v2.0.0-rc4 : change the user input workaround

*fix*
> [scripts]
  | [bootstrap] force input validation even in curl mode
This commit is contained in:
YannMagnin 2023-12-18 17:56:20 +01:00
parent c7fefee2ed
commit 85547d0fec
No known key found for this signature in database
GPG Key ID: D82629D933EADC59
3 changed files with 7 additions and 5 deletions

View File

@ -130,7 +130,7 @@ then
"$TAG Based on $pm, some dependencies are missing: $missing\n" \
"$TAG Do you want to run '$pm_install $missing' to install " \
'them [nY]? '
read -r do_install
read -r do_install < /dev/tty
if [[ "$do_install" != 'n' ]]
then
bash -c "$pm_install $missing"

View File

@ -110,9 +110,9 @@ then
echo " - Binutils version: $version_binutils"
echo " - Clone directory: $prefix_clone"
echo " - Compliler install at: $prefix_install"
read -p 'Process ? [yN]: ' -r valid
read -p 'Process ? [yN]: ' -r valid < /dev/tty
else
read -p 'Uninstall the sh-elf-vhex compiler ? [yN]: ' -r valid
read -p 'Uninstall the sh-elf-vhex compiler ? [yN]: ' -r valid < dev/tty
fi
# check if the stdin exists, which is not the case when the script is piped

View File

@ -113,8 +113,10 @@ echo "$TAG install dependencies..."
cd ./archive || exit 1
if ! utils_warn_callcmd ./contrib/download_prerequisites
then
echo "The installation of GCC's prerequisites has failed"
read -p 'Do you want to continue the installation ? [yN]: ' -r valid
echo -en \
'The installation of GCC'\''s prerequisites has failed\n' \
'Do you want to continue the installation ? [yN]: '
read -r valid < /dev/tty
if [[ "$valid" != 'y' ]]; then
echo 'Operation aborted o(x_x)o'
exit 1