@@ -7,17 +7,20 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
7
7
# Default parameter values
8
8
TRANSFORM_NOTEBOOKS=" "
9
9
DOWNLOAD_REPO=" "
10
- DEFAULT_KHIOPS_TUTORIAL_REPO_URL=" git@github.com:KhiopsML/khiops-python-tutorial.git"
10
+ DEFAULT_KHIOPS_TUTORIAL_REPO_URL=" https://github.com/KhiopsML/khiops-python-tutorial.git"
11
+ DEFAULT_KHIOPS_TUTORIAL_REPO_REF=" main"
11
12
DEFAULT_KHIOPS_TUTORIAL_DIR=" ${SCRIPT_DIR} /khiops-python-tutorial"
12
13
13
14
# Function to display the usage help
14
15
usage () {
15
- echo " Usage: create-doc [-r REPO_URL] [-d] [-t] [-l]"
16
+ echo " Usage: create-doc [-r REPO_URL] [-d] [-t] [-g] [- l]"
16
17
echo " Options:"
17
18
echo " -d: Downloads the Khiops tutorial repository. Implies -t. See also -r."
18
19
echo " -t: Transform the Khiops Jupyter notebooks tutorials into reST."
19
- echo " -r: Set the Khiops tutorial repository. The default is"
20
+ echo " -r: Set the Khiops tutorial repository URL . The default is"
20
21
echo " '$DEFAULT_KHIOPS_TUTORIAL_REPO_URL '."
22
+ echo " -g: Set the Khiops tutorial repository Git reference. The default is"
23
+ echo " '$DEFAULT_KHIOPS_TUTORIAL_REPO_REF '."
21
24
echo " -l: Directory of the local copy of the khiops tutorial repository. The default is"
22
25
echo " '$DEFAULT_KHIOPS_TUTORIAL_DIR '."
23
26
echo " "
@@ -29,17 +32,19 @@ exit_bad() {
29
32
}
30
33
31
34
# Read command line arguments
32
- while getopts " dtr :l:" opt
35
+ while getopts " dtrg :l:" opt
33
36
do
34
37
case " $opt " in
35
38
d ) DOWNLOAD_REPO=true && TRANSFORM_NOTEBOOKS=" true" ;;
36
39
t ) TRANSFORM_NOTEBOOKS=" true" ;;
37
40
r ) KHIOPS_TUTORIAL_REPO_URL=" $OPTARG " ;;
41
+ g ) KHIOPS_TUTORIAL_REPO_REF=" $OPTARG " ;;
38
42
l ) KHIOPS_TUTORIAL_REPO_DIR=" $OPTARG " ;;
39
43
* ) exit_bad ;;
40
44
esac
41
45
done
42
46
KHIOPS_TUTORIAL_REPO_URL=" ${KHIOPS_TUTORIAL_REPO_URL:- $DEFAULT_KHIOPS_TUTORIAL_REPO_URL } "
47
+ KHIOPS_TUTORIAL_REPO_REF=" ${KHIOPS_TUTORIAL_REPO_REF:- $DEFAULT_KHIOPS_TUTORIAL_REPO_REF } "
43
48
KHIOPS_TUTORIAL_REPO_DIR=" ${KHIOPS_TUTORIAL_REPO_DIR:- $DEFAULT_KHIOPS_TUTORIAL_DIR } "
44
49
45
50
69
74
# Clone the Khiops tutorial repository
70
75
if [[ $DOWNLOAD_REPO ]]
71
76
then
72
- echo " Obtaining khiops-python-tutorial"
77
+ echo " Obtaining khiops-python-tutorial revision $KHIOPS_TUTORIAL_REPO_REF "
73
78
rm -rf " $KHIOPS_TUTORIAL_REPO_DIR "
74
- khiops_python_tutorial_repo_branch=" main"
75
- git clone --depth 1 --branch=" $khiops_python_tutorial_repo_branch " \
79
+ git clone --depth 1 --branch=" $KHIOPS_TUTORIAL_REPO_REF " \
76
80
" $KHIOPS_TUTORIAL_REPO_URL " " $KHIOPS_TUTORIAL_REPO_DIR " \
77
81
&& rm -rf " $KHIOPS_TUTORIAL_REPO_DIR /.git"
78
82
fi
0 commit comments