-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit_push
More file actions
executable file
·71 lines (63 loc) · 2.04 KB
/
Copy pathgit_push
File metadata and controls
executable file
·71 lines (63 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
set -e # exit on any error
if [ -n "$1" ]; then
echo "---------------------------------------------------------------"
echo "✅ commit message = "$1
else
echo "❌ commit message must be given as a parameter of this git_push command"
echo "exit"
exit 1
fi
echo "---------------------------------------------------------------"
echo "First finding if there are large files in [sub]folders"
find . -size +49M -print | sed 's|^\./||' > .LargeFiles
/bin/cp .gitignore .gitignore.bak
cat .gitignore_base .LargeFiles > .gitignore
echo "Content of the .gitignore file"
cat .gitignore
echo "---------------------------------------------------------------"
echo "now processing git status"
git status
echo "---------------------------------------------------------------"
echo "🛠️ Updating local installation (Editable mode)"
set +e # Désactive temporairement l'arrêt automatique
pip install -e .
PIP_STATUS=$?
set -e # Réactive l'arrêt automatique
if [ $PIP_STATUS -eq 0 ]; then
echo "✅ Installation locale réussie."
else
echo "❌ Échec de l'installation locale (vérifiez votre pyproject.toml)."
echo "Fermeture du script. Aucun push effectué."
exit 1
fi
# --- NEW DOCUMENTATION SECTION ---
echo "---------------------------------------------------------------"
echo "📚 Updating API Documentation (sphinx-apidoc)"
# -f force overwrite, -M modules at top
sphinx-apidoc -f -M -o docs/source/ ./pyphyschemtools/
echo "🏗️ Building HTML Documentation"
cd docs
make html
cd ..
# ---------------------------------
while true; do
read -p "Do you wish to add > commit > push? (y/n) " yn
case $yn in
[Yy]* )
echo "---------------------------------------------------------------"
echo "Now processing git add > commit > push"
git add --all
git status
git commit -m "$1"
git push
break
;;
[Nn]* )
exit
;;
* )
echo "Please answer yes (y) or no (n)."
;;
esac
done