2024-09-06 23:21:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Erreur : Veuillez spécifier un nom de dossier de livre à mettre à jour." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "mise à jour du dossier $1 sans modifier les contenus Org"
|
|
|
|
|
|
|
|
dossier=$1
|
|
|
|
|
2024-09-08 22:49:11 +02:00
|
|
|
|
|
|
|
if ! [ -d $dossier ]; then
|
2024-10-15 19:12:23 +02:00
|
|
|
echo "le dossier $dossier n'existe pas, oh noes! ajoutez le en argument à ce script: \n bash update_ebook.sh /$USER/Nextcloud/textes/livre_bidule"
|
2024-09-08 22:49:11 +02:00
|
|
|
else
|
2024-10-15 19:12:23 +02:00
|
|
|
# on supprime les scripts existants
|
|
|
|
rm "$dossier/*.py"
|
|
|
|
rm "$dossier/*.sh"
|
|
|
|
rm "$dossier/*.css"
|
|
|
|
|
|
|
|
# on met les nouvelles versions
|
|
|
|
cp Makefile "$dossier/"
|
2024-09-08 22:49:11 +02:00
|
|
|
cp *.py "$dossier/"
|
|
|
|
cp *.sh "$dossier/"
|
|
|
|
cp *.css "$dossier/"
|
|
|
|
cp README.md "$dossier/"
|
|
|
|
cp LICENSE "$dossier/"
|
2024-10-15 19:12:23 +02:00
|
|
|
|
2024-09-08 22:49:11 +02:00
|
|
|
if ! [ -d $dossier/.git ]; then
|
2024-10-15 19:12:23 +02:00
|
|
|
cd $dossier
|
|
|
|
git init
|
2024-09-08 22:49:11 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2024-09-06 23:21:29 +02:00
|
|
|
|
2024-10-15 19:12:23 +02:00
|
|
|
echo "dossier $dossier mis à jour"
|