From f0bbbb99292adbbc81389762ffd94e9cce0682ee Mon Sep 17 00:00:00 2001 From: rpelmegov Date: Mon, 30 Jan 2023 07:14:20 +0300 Subject: [PATCH] issue-276 add bad path alarm --- scripts/export_src.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index aaea205..275c6bf 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -46,10 +46,15 @@ done find . -name ".git*" -print0 | xargs -0 rm -rf 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 - echo "Abort the script" - exit + echo "Export aborted! Invalid characters found in file or directories name(s):" + printf "%s\n" "${ERR_PATH_ARR[@]}" + exit fi open .