issue-276 add bad path alarm

This commit is contained in:
rpelmegov 2023-01-30 07:14:20 +03:00 committed by GitHub
parent 45fbc84578
commit f0bbbb9929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -46,10 +46,15 @@ done
find . -name ".git*" -print0 | xargs -0 rm -rf find . -name ".git*" -print0 | xargs -0 rm -rf
zip -r -q ${SRC_FOLDER_NAME}.zip . zip -r -q ${SRC_FOLDER_NAME}.zip .
if find . -name "*[<>:\\|?*]*" | xargs -I %s echo "in path %s" | xargs -0 echo "Invalid characters [<>:\|?*]" | grep . IFS="\n"
ERR_PATH_ARR=($(find . -name "*[<>:\\|?*]*" | xargs -I %s echo "- %s"))
unset IFS
if [ ${#ERR_PATH_ARR[@]} != 0 ]
then then
echo "Abort the script" echo "Export aborted! Invalid characters found in file or directories name(s):"
exit printf "%s\n" "${ERR_PATH_ARR[@]}"
exit
fi fi
open . open .