mirror of
https://github.com/rossant/awesome-math.git
synced 2024-09-28 20:05:42 +00:00
26 lines
657 B
Bash
Executable File
26 lines
657 B
Bash
Executable File
#!/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
|