Proper cleanup of old python protobuf libraries. (#667)

This commit is contained in:
Daniel Markstedt 2022-02-14 15:30:33 -08:00 committed by GitHub
parent 45cd5e58d1
commit 46d23a0d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,9 +113,17 @@ function installRaScsi() {
} }
function preparePythonCommon() { function preparePythonCommon() {
if [ -f "$PYTHON_COMMON_PATH/rascsi_interface_pb2.py" ]; then if [ -f "$WEB_INSTALL_PATH/src/rascsi_interface_pb2.py" ]; then
sudo rm "$PYTHON_COMMON_PATH/rascsi_interface_pb2.py" sudo rm "$WEB_INSTALL_PATH/src/rascsi_interface_pb2.py"
echo "Deleting old Python protobuf library rascsi_interface_pb2.py" echo "Deleting old Python protobuf library $WEB_INSTALL_PATH/src/rascsi_interface_pb2.py"
fi
if [ -f "$OLED_INSTALL_PATH/src/rascsi_interface_pb2.py" ]; then
sudo rm "$OLED_INSTALL_PATH/src/rascsi_interface_pb2.py"
echo "Deleting old Python protobuf library $OLED_INSTALL_PATH/src/rascsi_interface_pb2.py"
fi
if [ -f "$PYTHON_COMMON_PATH/src/rascsi_interface_pb2.py" ]; then
sudo rm "$PYTHON_COMMON_PATH/src/rascsi_interface_pb2.py"
echo "Deleting old Python protobuf library $PYTHON_COMMON_PATH/src/rascsi_interface_pb2.py"
fi fi
echo "Compiling the Python protobuf library rascsi_interface_pb2.py..." echo "Compiling the Python protobuf library rascsi_interface_pb2.py..."
protoc -I="$BASE/src/raspberrypi/" --python_out="$PYTHON_COMMON_PATH/src" rascsi_interface.proto protoc -I="$BASE/src/raspberrypi/" --python_out="$PYTHON_COMMON_PATH/src" rascsi_interface.proto