Fix file download logic to skip already downloaded files
This commit is contained in:
6
download_prerequisites.sh
Normal file → Executable file
6
download_prerequisites.sh
Normal file → Executable file
@@ -23,9 +23,13 @@ echo "Начинаю загрузку файлов в папку 'src'..."
|
|||||||
# Загружаем каждый файл
|
# Загружаем каждый файл
|
||||||
for url in "${files[@]}"; do
|
for url in "${files[@]}"; do
|
||||||
filename=$(basename "$url")
|
filename=$(basename "$url")
|
||||||
|
if [ -f "$filename" ]; then
|
||||||
|
echo "⊘ Пропускаю (уже загружен): $filename"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
echo "Загружаю: $filename"
|
echo "Загружаю: $filename"
|
||||||
wget -q --show-progress "$url"
|
wget -q --show-progress "$url"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "✓ Успешно: $filename"
|
echo "✓ Успешно: $filename"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user