Skip to content

Commit 8a8c2fb

Browse files
committed
splits installation of tools to be separate for python and go
1 parent 70eaa48 commit 8a8c2fb

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project-help:
66
@$(SCRIPTS_BASE)/project.sh help
77

88
project-tools:
9-
@$(SCRIPTS_BASE)/project.sh tools
9+
@$(SCRIPTS_BASE)/project.sh tools "$(LANGUAGE)"
1010

1111
# GENERATE
1212
download-oas:

scripts/generate-sdk/languages/python.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ generate_python_sdk() {
5858

5959
# Install SDK project tools
6060
cd ${ROOT_DIR}
61-
make project-tools
61+
make project-tools LANGUAGE=python
6262

6363
# Backup of the current state of the SDK services dir (services/)
6464
sdk_services_backup_dir=$(mktemp -d)

scripts/project.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,24 @@ SDK_PATH="${ROOT_DIR}/sdk"
1111

1212
action=$1
1313

14+
if [[ -z $2 ]]; then
15+
echo "LANGUAGE not specified, default will be used."
16+
LANGUAGE="go"
17+
else
18+
LANGUAGE=$2
19+
fi
20+
1421
if [ "$action" = "help" ]; then
1522
[ -f "$0".man ] && man "$0".man || echo "No help, please read the script in ${script}, we will add help later"
1623
elif [ "$action" = "tools" ]; then
1724
cd ${ROOT_DIR}
18-
19-
go install golang.org/x/tools/cmd/goimports@latest
20-
pip install black==24.8.0 isort~=5.13.2 autoimport~=1.6.1
25+
if [ "${LANGUAGE}" == "go" ]; then
26+
go install golang.org/x/tools/cmd/goimports@latest
27+
elif [ "${LANGUAGE}" == "python" ]; then
28+
pip install black==24.8.0 isort~=5.13.2 autoimport~=1.6.1
29+
else
30+
echo "Invalid language: `$LANGUAGE`, please use $0 help for help"
31+
fi
2132
else
2233
echo "Invalid action: '$action', please use $0 help for help"
2334
fi

0 commit comments

Comments
 (0)