diff --git a/src/package/validate_input_packages.sh b/src/package/validate_input_packages.sh index ce183ef..abaec06 100644 --- a/src/package/validate_input_packages.sh +++ b/src/package/validate_input_packages.sh @@ -8,15 +8,18 @@ validate_input_packages() { echo "$package_list" | xargs | sed 's/ /\n/g' | while read -r package; do - if echo "$package" | grep -q "$invalid_characters_pattern"; then - log user "Invalid package: $package (contains invalid characters)" - return 1 - fi - if grep -qw "$package" "$PACKAGE_CACHE"; then - log debug "Found in package cache: $package" - else - log user "Invalid package: $package (not found in package cache)" - return 1 - fi -done + if echo "$package" | grep -q "$invalid_characters_pattern"; then + log user "Invalid package: $package (contains invalid characters)" + return 1 + fi + + update_package_cache + + if grep -qw "$package" "$PACKAGE_CACHE"; then + log debug "Found in package cache: $package" + else + log user "Invalid package: $package (not found in package cache)" + return 1 + fi + done } diff --git a/tori b/tori index 77a5a6b..e7dcd5a 100755 --- a/tori +++ b/tori @@ -34,7 +34,6 @@ main() { # startup checks prepare_directories - update_package_cache # entry point