Skip to content
Open
Changes from 4 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
14 changes: 14 additions & 0 deletions scripts/export_src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,18 @@ done
find . -name ".git*" -print0 | xargs -0 rm -rf
zip -r -q ${SRC_FOLDER_NAME}.zip .

read_err_path() {
read -d $'\0' err_path
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

а нам точно нужна отдельная функция? можем этот код перенести к while?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Вынесено в функцию, чтобы дублирования не было


find . -name "*[<>:\\|?*]*" -print0 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

вот тут я сломался. что тут происходит, куда уходит результат?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Результат читается построчно в функции read_err_path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

не ну это жесть какая-то. ищем в одной строчке, читаем в функции, а используем вообще дальше
давай попытаемся сделать как в нормальных языках программирования: переменные, зона видимости и вот это всё

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exit без кода что вернёт?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Вроде бы то же, что exit 0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Можно exit 1 написать, раз завершение с ошибкой, но разница будет ли

fi

open .