Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/export_src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,15 @@ done
find . -name ".git*" -print0 | xargs -0 rm -rf
zip -r -q ${SRC_FOLDER_NAME}.zip .

IFS="\n"
ERR_PATH_ARR=($(find . -name "*[<>:\\|?*]*" | xargs -I %s echo "- %s"))
unset IFS

if [ ${#ERR_PATH_ARR[@]} != 0 ]
then
echo "Export aborted! Invalid characters found in file or directories name(s):"
printf "%s\n" "${ERR_PATH_ARR[@]}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

массивы это bash расширение, в чистом sh надо на пустую строку или return code проверять

я предлагаю после вызова find проверить return code или строку на пустоту, потом вывести первую строки, а затем пройтись for по оставшимся результатам, тогда и xargs вроде не надо

exit
fi

open .