From d78f83d5e5e2aca0d140c1941afa4e0ee1a3aad7 Mon Sep 17 00:00:00 2001 From: valentinbreiz Date: Wed, 3 Jan 2024 15:43:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20installer=20not=20starting?= =?UTF-8?q?=20(put=20path)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/make_installer_protos.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/make_installer_protos.sh b/scripts/make_installer_protos.sh index 030b383..c5d74bb 100644 --- a/scripts/make_installer_protos.sh +++ b/scripts/make_installer_protos.sh @@ -7,12 +7,19 @@ PROTO_OUTPUT_DIR=$INSTALLER_DIR/src/protos cd $INSTALLER_DIR +# Create the protos output directory if it doesn't exist mkdir -p $PROTO_OUTPUT_DIR +# Generate the Python gRPC code from the .proto files python3 -m grpc_tools.protoc \ - -I${PROTO_DIR} \ - --python_out=${PROTO_OUTPUT_DIR} \ - --mypy_out=${PROTO_OUTPUT_DIR} \ - --grpc_python_out=${PROTO_OUTPUT_DIR} \ - --mypy_grpc_out=${PROTO_OUTPUT_DIR} \ - ${PROTO_DIR}/*.proto + -I${PROTO_DIR} \ + --python_out=${PROTO_OUTPUT_DIR} \ + --mypy_out=${PROTO_OUTPUT_DIR} \ + --grpc_python_out=${PROTO_OUTPUT_DIR} \ + --mypy_grpc_out=${PROTO_OUTPUT_DIR} \ + ${PROTO_DIR}/*.proto + +# Create __init__.py file in the protos directory +echo "import sys" > $PROTO_OUTPUT_DIR/__init__.py +echo "import os" >> $PROTO_OUTPUT_DIR/__init__.py +echo "sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))" >> $PROTO_OUTPUT_DIR/__init__.py