Skip to content

Commit 8c916f5

Browse files
committed
Make the Khiops Python tutorial repository reference customizable
Thus, we can choose which v10 vs v11 tutorial versions to use when building the Python API docs.
1 parent 8991cf7 commit 8c916f5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/create-doc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
88
TRANSFORM_NOTEBOOKS=""
99
DOWNLOAD_REPO=""
1010
DEFAULT_KHIOPS_TUTORIAL_REPO_URL="git@github.com:KhiopsML/khiops-python-tutorial.git"
11+
DEFAULT_KHIOPS_TUTORIAL_REPO_REF="main"
1112
DEFAULT_KHIOPS_TUTORIAL_DIR="${SCRIPT_DIR}/khiops-python-tutorial"
1213

1314
# Function to display the usage help
1415
usage() {
15-
echo "Usage: create-doc [-r REPO_URL] [-d] [-t] [-l]"
16+
echo "Usage: create-doc [-r REPO_URL] [-d] [-t] [-g] [-l]"
1617
echo "Options:"
1718
echo " -d: Downloads the Khiops tutorial repository. Implies -t. See also -r."
1819
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"
2021
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'."
2124
echo " -l: Directory of the local copy of the khiops tutorial repository. The default is"
2225
echo " '$DEFAULT_KHIOPS_TUTORIAL_DIR'."
2326
echo ""
@@ -29,17 +32,19 @@ exit_bad() {
2932
}
3033

3134
# Read command line arguments
32-
while getopts "dtr:l:" opt
35+
while getopts "dtrg:l:" opt
3336
do
3437
case "$opt" in
3538
d ) DOWNLOAD_REPO=true && TRANSFORM_NOTEBOOKS="true" ;;
3639
t ) TRANSFORM_NOTEBOOKS="true" ;;
3740
r ) KHIOPS_TUTORIAL_REPO_URL="$OPTARG" ;;
41+
g ) KHIOPS_TUTORIAL_REPO_REF="$OPTARG" ;;
3842
l ) KHIOPS_TUTORIAL_REPO_DIR="$OPTARG" ;;
3943
* ) exit_bad ;;
4044
esac
4145
done
4246
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}"
4348
KHIOPS_TUTORIAL_REPO_DIR="${KHIOPS_TUTORIAL_REPO_DIR:-$DEFAULT_KHIOPS_TUTORIAL_DIR}"
4449

4550

@@ -71,8 +76,7 @@ if [[ $DOWNLOAD_REPO ]]
7176
then
7277
echo "Obtaining khiops-python-tutorial"
7378
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" \
7680
"$KHIOPS_TUTORIAL_REPO_URL" "$KHIOPS_TUTORIAL_REPO_DIR" \
7781
&& rm -rf "$KHIOPS_TUTORIAL_REPO_DIR/.git"
7882
fi

0 commit comments

Comments
 (0)