Skip to content

Commit

Permalink
fd test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-nelson committed Jan 23, 2021
1 parent f0656de commit 9371926
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 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"]
14 changes: 7 additions & 7 deletions entrypoint.sh
Expand Up @@ -73,10 +73,10 @@ handle_files () {
echo -e "${RED}ERROR [鉁朷 Can't find the file: ${YELLOW}${FILELIST[index]}${NC}"
exit 2
fi
if [ "$index" == 0 ]; then
COMMAND_FILES+=("-wholename ${FILELIST[index]}")
if [ $index == 0 ]; then
COMMAND_FILES+=("${FILELIST[index]}")
else
COMMAND_FILES+=("-o -wholename ${FILELIST[index]}")
COMMAND_FILES+=("|${FILELIST[index]}")
fi
done
FILES="${COMMAND_FILES[*]}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9371926

Please sign in to comment.