enhance makefile completion - remove use of find

pull/1502/head
cornfeedhobo 2020-02-21 22:27:56 -06:00
parent 552cd89851
commit 239f708637
No known key found for this signature in database
GPG Key ID: 724357093F994B26
1 changed files with 3 additions and 3 deletions

View File

@ -8,9 +8,9 @@ _makecomplete() {
# https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html
local files=()
while IFS='' read -r line; do
files+=("$line")
done < <(find . -maxdepth 1 -regextype posix-extended -regex '.*(GNU)?[Mm]akefile$' -printf '%f\n')
for f in 'GNUmakefile' 'makefile' 'Makefile' ; do
[ -f "$f" ] && files+=("$f")
done
[ "${#files[@]}" -eq 0 ] && return 0