sh-elf-vhex - v2.0.0-rc3 : fix input validation skip in curl operation

*fix*
> [scripts]
  | [bootstrap] fix check if the `stdin` is available before request user input
This commit is contained in:
YannMagnin 2023-12-18 17:18:17 +01:00
parent 5bca98ca63
commit c7fefee2ed
No known key found for this signature in database
GPG Key ID: D82629D933EADC59
1 changed files with 8 additions and 3 deletions

View File

@ -69,7 +69,7 @@ then
then
echo -e \
"It seems that the project is already existing :pouce:\n" \
'If you really want to install this project use the "--overwrite"' \
'If you really want to reinstall this project use the "--overwrite"' \
'option.'
exit 1
fi
@ -114,12 +114,17 @@ then
else
read -p 'Uninstall the sh-elf-vhex compiler ? [yN]: ' -r valid
fi
if [[ -t 0 && "$valid" != 'y' ]]; then
# check if the stdin exists, which is not the case when the script is piped
# with bash (cat ./script/bootstrap.sh | bash)
if [[ -t 0 ]]
then
if [[ "$valid" != 'y' ]]; then
echo 'Operation aborted o(x_x)o'
exit 1
fi
fi
#---
# Performs install/uninstall operation
#---