Fix grep call in ppa.sh

When distros use DEB822-STYLE .sources file or a custom default list file the list_file is not present, so we check if it exists before calling grep on it
This commit is contained in:
Shivam Mathur 2023-07-02 02:16:13 +05:30
parent 9d529a72e0
commit f1cc14e3d5
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -59,7 +59,7 @@ update_lists() {
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
status_file=/tmp/"${ppa/\//_}"
elif grep -Eq '^deb ' "$list_file"; then
elif [ -e "$list_file" ] && grep -Eq '^deb ' "$list_file"; then
list="$list_file"
fi
if [ ! -e "$status_file" ]; then