Skip to content

Commit

Permalink
Fix grep call in ppa.sh
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shivammathur committed Jul 1, 2023
1 parent 9d529a7 commit f1cc14e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/tools/ppa.sh
Expand Up @@ -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
Expand Down

0 comments on commit f1cc14e

Please sign in to comment.