mirror of
https://github.com/opnsense/core.git
synced 2026-05-28 04:34:51 -04:00
make: make `vim' target even more lazy
Match the file name without left anchor and look for a partial directory match if a director was specified.
This commit is contained in:
parent
854238a1fc
commit
286dfcb6a6
1 changed files with 4 additions and 2 deletions
|
|
@ -146,8 +146,10 @@ checkout:
|
|||
vim:
|
||||
.for DIR in ${.CURDIR}/src
|
||||
.if exists(${DIR})
|
||||
@FOUND="$$(find ${.CURDIR}/src -type f -name "$$(basename '${vim_ARG}')*" | \
|
||||
grep -F '${vim_ARG}')"; \
|
||||
@FOUND="$$(find ${.CURDIR}/src -type f -iname "*$$(basename '${vim_ARG}')*")"; \
|
||||
if [ -n "$${FOUND}" -a "$$(dirname '${vim_ARG}')" != "." ]; then \
|
||||
FOUND="$$(echo "$${FOUND}" | grep -iF "$$(dirname '${vim_ARG}')")"; \
|
||||
fi; \
|
||||
if [ -n "$${FOUND}" ]; then \
|
||||
if [ "$$(echo "$${FOUND}" | wc -l | awk '{ print $$1 }')" = "1" ]; then \
|
||||
${VIM} "$${FOUND}"; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue