@@ -10,6 +10,8 @@ set -o errexit # set -e : exit the script if any statement returns a non-true
10
10
11
11
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Welcome to the book building script."
12
12
13
+ argument=" ${1:- } " # get command line argument, if any
14
+
13
15
currentDir=" $( pwd) "
14
16
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We are working in directory: '$currentDir '."
15
17
scriptDir=" $currentDir /scripts"
@@ -22,22 +24,27 @@ rm -rf "$currentDir/website" || true
22
24
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We setup a virtual environment in a temp directory."
23
25
venvDir=" $( mktemp -d) "
24
26
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Got temp dir '$venvDir ', now creating environment in it."
25
- python3 -m venv --system-site-packages " $venvDir "
27
+ python3 -m venv --upgrade-deps --copies " $venvDir "
26
28
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Activating virtual environment in '$venvDir '."
27
- . " $venvDir /bin/activate"
29
+ source " $venvDir /bin/activate"
28
30
export PYTHON_INTERPRETER=" $venvDir /bin/python3"
29
31
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Setting python interpreter to '$PYTHON_INTERPRETER '."
30
32
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We install all required Python packages from requirements.txt to virtual environment in '$venvDir '."
31
- pip install --no-input --timeout 360 --retries 100 -r requirements.txt
33
+ " $PYTHON_INTERPRETER " -m pip install --no-input --timeout 360 --retries 100 -r requirements.txt
32
34
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Finished installing the requirements, now printing all installed packages."
33
35
pip freeze
34
36
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Finished printing all installed packages."
35
37
36
38
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We now execute the pdflatex compiler script."
37
39
" $scriptDir /pdflatex.sh" " book.tex"
38
40
39
- echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We now execute the website building script."
40
- " $scriptDir /website.sh"
41
+ if [ " $argument " == " --no-website" ]; then
42
+ echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Website generation has been disabled."
43
+ else
44
+ echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : We now execute the website building script."
45
+ " $scriptDir /website.sh"
46
+ echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Website has been generated."
47
+ fi
41
48
42
49
echo " $( date +' %0Y-%0m-%0d %0R:%0S' ) : Deactivating virtual environment."
43
50
deactivate
0 commit comments