Merge 99d2c46085223938fac2b3bfefb8a3677406c822 into 3892c134ca7dbe656fc49a954e7cb2b2aeb0835d

This commit is contained in:
Deleted user 2024-09-12 04:27:41 +00:00 committed by GitHub
commit 8c8e64c9d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pdf

25
download-all-pdf.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# --------------------------------- Create the pdf directory if not exists --
if [ ! -d pdf ]; then
mkdir pdf
fi
# ---------------------------------------- Add pdf directory to .gitignore --
if [ ! -f .gitignore ]; then
echo pdf > .gitignore
else
grep -q -F 'pdf' .gitignore || echo 'pdf' >> .gitignore
fi
# ---------------------------------------- Download pdf file if not exists --
for f in `sed -rn 's/.*(http.+\.pdf).*/\1/pg' README.md`
do
if [ ! -f "pdf/${f##*/}" ]; then
wget --tries=3 \
--timeout=5 \
--waitretry=1 \
--retry-connrefused \
"$f" -P pdf
fi
done