2021-01-12 14:20:08 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-03-05 16:18:59 +01:00
|
|
|
# This script is executed by make in the parent directory
|
|
|
|
|
2021-01-12 14:20:08 +01:00
|
|
|
[ "$HOSTNAME" != lime2 ] || exit 1
|
|
|
|
|
2021-09-05 18:26:40 +02:00
|
|
|
main() {
|
|
|
|
verbose -n "Pulling CV... "
|
|
|
|
|
|
|
|
cp ~/src/html-cv/out.html ./cv/index.html
|
|
|
|
hide_phone
|
|
|
|
hide_address
|
|
|
|
hide_city
|
|
|
|
cp ~/src/html-cv/data/cv-photo ./cv/data/cv-photo
|
|
|
|
cp ~/src/html-cv/data/internet-icon.png ./cv/data/internet-icon.png
|
|
|
|
cp ~/src/html-cv/data/git-icon.png ./cv/data/git-icon.png
|
|
|
|
cp -r ~/src/html-cv/css ./cv
|
|
|
|
|
|
|
|
if git status | grep cv | grep -v 'pull-cv.sh' -c >/dev/null 2>&1; then
|
|
|
|
echo "Updated CV"
|
|
|
|
fi
|
|
|
|
|
|
|
|
verbose "Done"
|
|
|
|
}
|
|
|
|
|
|
|
|
hide_phone() {
|
|
|
|
sed -i -E 's/\+33 6( [0-9]{2}){4}/[téléphone caché]/' ./cv/index.html
|
|
|
|
}
|
|
|
|
|
|
|
|
hide_address() {
|
|
|
|
sed -i -E 's/[0-9]{2,3} (rue|avenue|av\.?|boulevard|bld|place|pl\.?) [a-zA-Z ]+/[adresse cachée]/' ./cv/index.html
|
|
|
|
}
|
|
|
|
|
|
|
|
hide_city() {
|
|
|
|
sed -i -E 's/[0-9]{5} [a-zA-Z]+/[code postal et ville cachés]/' ./cv/index.html
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose() {
|
|
|
|
if [ "$VERBOSE" = true ]; then
|
|
|
|
echo "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|