From c5be4329998ae7210a8a9453596fd96c7a60f522 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Mon, 27 Mar 2023 15:06:07 +0800 Subject: [PATCH] scripts: Add check for zap download --- .gitignore | 1 + install.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9e2d2c6a2..a70301abf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__/ out/ _build/ tools/chip-tool/ +.zap/ diff --git a/install.sh b/install.sh index ffd17a641..3ef664bdb 100755 --- a/install.sh +++ b/install.sh @@ -22,7 +22,17 @@ echo "" zap_path=`python3 ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip/scripts/tools/zap/zap_download.py \ --sdk-root ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip --zap RELEASE --zap-version v2023.03.06-nightly \ --extract-root .zap 2>/dev/null | cut -d= -f2` -# Move files to one directory up, so that binaries will be in zap/ directory and export.sh can leverage the fixed path +# Check whether the download is successful. +if [ -z $zap_path ]; then + echo "Failed to install zap-cli" + deactivate + exit 1 +fi + +# Move files to one directory up, so that binaries will be in $ESP_MATTER_PATH/.zap/ directory and export.sh can leverage the fixed path +if [ -d "${ESP_MATTER_PATH}/.zap" ]; then + rm -r ${ESP_MATTER_PATH}/.zap +fi mkdir ${ESP_MATTER_PATH}/.zap mv $zap_path/* ${ESP_MATTER_PATH}/.zap/ rm -r $zap_path