From 5fa0fd4d6ea1c8066a139c6aef0b93be12e91c2c Mon Sep 17 00:00:00 2001 From: Gaurav Nelson Date: Wed, 19 Aug 2020 20:23:32 +1000 Subject: [PATCH] fd test --- Dockerfile | 2 +- entrypoint.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c227e2..6ed798d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM node:alpine -RUN apk add --no-cache bash>5.0.16-r0 git>2.26.0-r0 +RUN apk add --no-cache bash>5.0.16-r0 git>2.26.0-r0 fd>8.1.1-r0 COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 17e339c..5d0e468 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -74,9 +74,9 @@ handle_files () { exit 2 fi if [ $index == 0 ]; then - COMMAND_FILES+=("-wholename ${FILELIST[index]}") + COMMAND_FILES+=("${FILELIST[index]}") else - COMMAND_FILES+=("-o -wholename ${FILELIST[index]}") + COMMAND_FILES+=("|${FILELIST[index]}") fi done FILES="${COMMAND_FILES[*]}" @@ -125,9 +125,9 @@ check_additional_files () { if [ -n "$FILES" ]; then if [ "$MAX_DEPTH" -ne -1 ]; then - FIND_CALL=('find' '.' '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-maxdepth' "${MAX_DEPTH}" '-exec' 'markdown-link-check' '{}') + FIND_CALL=('fd' '--type' 'f' '('"${FILES}"')' '--max-depth' "${MAX_DEPTH}" '.' '--exec' 'markdown-link-check') else - FIND_CALL=('find' '.' '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-exec' 'markdown-link-check' '{}') + FIND_CALL=('fd' '--type' 'f' '('"${FILES}"')' '.' '--exec' 'markdown-link-check') fi add_options @@ -182,9 +182,9 @@ if [ "$CHECK_MODIFIED_FILES" = "yes" ]; then else if [ "$5" -ne -1 ]; then - FIND_CALL=('find' ${FOLDERS} '-name' '*'"${FILE_EXTENSION}" '-not' '-path' './node_modules/*' '-maxdepth' "${MAX_DEPTH}" '-exec' 'markdown-link-check' '{}') + FIND_CALL=('fd' '.' ${FOLDERS} '-e' "${FILE_EXTENSION}" '--max-depth' "${MAX_DEPTH}" '--exec' 'markdown-link-check') else - FIND_CALL=('find' ${FOLDERS} '-name' '*'"${FILE_EXTENSION}" '-not' '-path' './node_modules/*' '-exec' 'markdown-link-check' '{}') + FIND_CALL=('fd' '.' ${FOLDERS} '-e' "${FILE_EXTENSION}" '--exec' 'markdown-link-check') fi add_options