Title: Fix downloader selection logic in zrep script

- Fixed logical OR conditions to logical AND in downloader selection.
- Improved user input validation for downloader selection.
- Added error messages for invalid downloader choices.
- Updated zrep script for correct downloader selection logic.
This commit is contained in:
Stig-Ørjan Smelror 2024-03-15 22:19:23 +01:00
parent 53bd010da6
commit 17355e5779

4
zrep
View File

@ -153,10 +153,10 @@ function zrep_init() {
read "install_dir?Enter zrep installation directory [${HOME}/.zrep]: "
install_dir=${install_dir:-"${HOME}/.zrep"}
read "downloader?Choose command to download packages [curl, wget, wget2]: "
if [[ ${downloader} != curl || ${downloader} != wget || ${downloader} != wget2 ]]; then
if [[ ${downloader} != curl && ${downloader} != wget && ${downloader} != wget2 ]]; then
echo "Invalid choice: '$downloader'. Try again."
read "downloader?Choose command to download packages [curl, wget, wget2] "
if [[ ${downloader} != curl || ${downloader} != wget || ${downloader} != wget2 ]]; then
if [[ ${downloader} != curl && ${downloader} != wget && ${downloader} != wget2 ]]; then
echo "Invalid choice: '$downloader'. Exiting."
exit
fi