From 6fae26a378cbcb3bd507b150529b27b7c9e056c6 Mon Sep 17 00:00:00 2001 From: yejinze Date: Wed, 18 Dec 2024 22:01:10 +0800 Subject: [PATCH] fix: directory copy issue --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f625e34..5873f13 100755 --- a/install.sh +++ b/install.sh @@ -20,8 +20,13 @@ rm -rf "$config_path/custom_components/xiaomi_home" script_path=$(dirname "$0") # Change to the script path. cd "$script_path" + # Copy the new version. -cp -r custom_components/xiaomi_home/ "$config_path/custom_components/" +if [ -d "$config_path/custom_components" ]; then + cp -r custom_components/xiaomi_home/ "$config_path/custom_components/" +else + cp -r custom_components/ "$config_path/custom_components/" +fi # Done. echo "Xiaomi Home installation is completed. Please restart Home Assistant."