forked from openapi-generators/openapi-python-client-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·31 lines (26 loc) · 821 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·31 lines (26 loc) · 821 Bytes
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
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
openapi_python_client_version=$1
openapi_file_path=$2
openapi_url=$3
config_file_path=$4
extra_args=$5
if [[ "$openapi_python_client_version" != "NOT_SPECIFIED" ]]; then
version_arg="openapi-python-client==${openapi_python_client_version}"
else
version_arg="openapi-python-client"
fi
if [[ "$config_file_path" != "NOT_SPECIFIED" ]]; then
config_arg="--config=${config_file_path}"
else
config_arg=""
fi
openapi_document_path_or_url_arg="--path=${openapi_file_path}"
if [[ "$openapi_url" != "NOT_SPECIFIED" ]]; then
openapi_document_path_or_url_arg="--url=${openapi_url}"
fi
PATH=$PATH:/github/home/.local/bin
pip install "${version_arg}"
# shellcheck disable=SC2086
openapi-python-client generate $config_arg $openapi_document_path_or_url_arg $extra_args