-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace in filename results in no file found #118
Comments
First off, it's better to copy a permalink (click on the Example with dummy lines: #! /bin/bash
mapfile -t FILE_ARRAY < <(printf "%s\n" 'words with spaces' 'more words' 'word' )
for i in "${FILE_ARRAY[@]}"
do
echo "VALUE: ${i}"
done
# Output:
VALUE: words with spaces
VALUE: more words
VALUE: word You can use the existing git command to get a diff with paths that also have spaces and will find the same sort of behaviour. No bug there. The command to collect files from a diff though... I haven't reviewed the whole script file, but your particular issue was probably due to earlier logic:
IFS=', ' read -r -a FILELIST <<< 'words with spaces,more words, word'
for i in "${FILELIST[@]}"
do
echo "VALUE: ${i}"
done
# Output:
VALUE: words
VALUE: with
VALUE: spaces
VALUE: more
VALUE: words
VALUE: word EDIT: Nope, my bad, I added a link to docs for that feature. I didn't focus on the lines you referenced, as they had been shifted (hence the value of permalink 😅 ) You were referencing back in Sep 2021: github-action-markdown-link-check/entrypoint.sh Lines 171 to 174 in 7a77bd1
Where those lines numbers now reference: github-action-markdown-link-check/entrypoint.sh Lines 171 to 174 in 228fbf4
So this line is the problem:
COMMAND="${FIND_CALL[*]}"
$COMMAND "${i}" &>> error.txt || true That will keep the array value quote wrapped, no need to append to the |
I have a project with a whitespace in the filename. This results in a rather useless error "ERROR: File not found! Please provide a valid filename as an argument.". After digging, it turns out https://github.com/tcort/markdown-link-check tries reading the filename up to the whitespace, so excluding everything after. Code where the filename is provided is here: https://github.com/gaurav-nelson/github-action-markdown-link-check/blob/master/entrypoint.sh#L171-L174.
I couldn't get it to work, so reporting an issue for the moment.
The text was updated successfully, but these errors were encountered: