mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
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:
parent
9d529a72e0
commit
f1cc14e3d5
@ -59,7 +59,7 @@ update_lists() {
|
|||||||
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
||||||
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
|
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
|
||||||
status_file=/tmp/"${ppa/\//_}"
|
status_file=/tmp/"${ppa/\//_}"
|
||||||
elif grep -Eq '^deb ' "$list_file"; then
|
elif [ -e "$list_file" ] && grep -Eq '^deb ' "$list_file"; then
|
||||||
list="$list_file"
|
list="$list_file"
|
||||||
fi
|
fi
|
||||||
if [ ! -e "$status_file" ]; then
|
if [ ! -e "$status_file" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user