Skip to content

Commit

Permalink
WIP:Do not merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-nelson committed Apr 9, 2021
1 parent 24cd99c commit 0e4cd88
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
uses: ./
with:
# Add a test to restrict the test to just dir4 and dir5.
folder-path: './md/dir4, ./md/dir5'
file-path: './md/AdditionalFileTest1.md, ./md/AdditionalFileTest2.md'
folder-path: 'md/dir4/, md/dir5/'
file-path: 'md/AdditionalFileTest1.md, md/AdditionalFileTest2.md'
check-modified-files-only: 'yes'
use-verbose-mode: 'yes'
shellcheck:
runs-on: [ubuntu-latest]
steps:
Expand Down
21 changes: 14 additions & 7 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ YELLOW='\033[0;33m'
BLUE='\033[0;34m'
RED='\033[0;31m'

npm i -g markdown-link-check@3.8.6
npm i -g markdown-link-check@3.8.7

declare -a FIND_CALL
declare -a COMMAND_DIRS COMMAND_FILES
Expand Down Expand Up @@ -142,7 +142,7 @@ check_additional_files () {

}

if [ -z "$8" ]; then
if [ -z "$4" ]; then
FOLDERS="."
else
handle_dirs
Expand All @@ -167,16 +167,23 @@ if [ "$CHECK_MODIFIED_FILES" = "yes" ]; then

for i in "${FILE_ARRAY[@]}"
do
echo "------------------------------> filename is ${i}"
if [ "${i##*.}" == "${FILE_EXTENSION#.}" ]; then
FIND_CALL+=("${i}")
COMMAND="${FIND_CALL[*]}"
$COMMAND &>> error.txt || true
unset 'FIND_CALL[${#FIND_CALL[@]}-1]'
echo "------------------------------> File extension match"
echo "------------------------------> filename: ${i##*/}"
if [ $(find ${FOLDERS} -name "${i##*/}" ) ]; then
echo "------------------------------> folders is ${FOLDERS}"
FIND_CALL+=("${i}")
COMMAND="${FIND_CALL[*]}"
echo "------------------------------> Command is ${COMMAND}"
$COMMAND &>> error.txt || true
unset 'FIND_CALL[${#FIND_CALL[@]}-1]'
fi
fi
done

check_additional_files

check_errors

else
Expand Down
6 changes: 6 additions & 0 deletions md/dir4/ok4.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@

Go to [Ok5](../dir5/ok5.md#test)

This [doesn't exists](#alpha).
But [missing files are reported](missing-example.js).

What about refs and definitions are [checked][beta].

[beta]: #beta
2 changes: 1 addition & 1 deletion md/file1.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is to test URLencoding.
<https://en.wikipedia.org/wiki/Glob_%28programming%29>
<https://www.google.com/?q=url%20with%20a%20space>

### Alpha
### Alpha check

This [exists](#alpha).
<!-- markdown-link-check-disable-next-line -->
Expand Down

0 comments on commit 0e4cd88

Please sign in to comment.