From 17355e57793393cdbef56f6b876e8a2628b29d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Fri, 15 Mar 2024 22:19:23 +0100 Subject: [PATCH] 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. --- zrep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zrep b/zrep index c4d9427..2ee54b6 100755 --- a/zrep +++ b/zrep @@ -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