From 302530f3c2e04da5fdae93c0ff1e5687bdce7bf0 Mon Sep 17 00:00:00 2001 From: rpelmegov Date: Mon, 27 Feb 2023 05:52:11 +0300 Subject: [PATCH] Update export_src.sh --- scripts/export_src.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 2639539..6e8680f 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -46,18 +46,10 @@ done find . -name ".git*" -print0 | xargs -0 rm -rf zip -r -q ${SRC_FOLDER_NAME}.zip . -read_err_path() { - read -d $'\0' err_path -} - -find . -name "*[<>:\\|?*]*" -print0 | -if read_err_path; then - echo "Export aborted! Invalid characters found in file or directories name(s):\n- $err_path" - while read_err_path - do - echo "- $err_path" - done - exit +ERR_PATHS=$(find . -name "*[<>:\\|?*]*" | xargs -I %s echo "- %s") +if [ "$ERR_PATHS" ]; then + echo "Export aborted! Invalid characters found in file or directories name(s):\n$ERR_PATHS" + exit 1 fi open .