Skip to content

Commit d586e02

Browse files
committed
Fix the copy script after changing the version tag format
1 parent 0d2e395 commit d586e02

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

custom_components/victron_mqtt/update_integration.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,30 @@ if [ "$LATEST_TAG" == "null" ] || [ -z "$LATEST_TAG" ]; then
2626
else
2727
echo "⬇️ Found latest release: $LATEST_TAG"
2828
ZIP_URL="https://github.com/$GITHUB_USER/$GITHUB_REPO/archive/refs/tags/$LATEST_TAG.zip"
29-
TMP_FOLDER="$GITHUB_REPO-$LATEST_TAG"
29+
# Remove 'v' prefix from tag for folder name
30+
TAG_WITHOUT_V="${LATEST_TAG#v}"
31+
TMP_FOLDER="$GITHUB_REPO-$TAG_WITHOUT_V"
3032
fi
3133

3234
# Create temp dir
3335
TMP_DIR=$(mktemp -d)
36+
echo "TMP_DIR=$TMP_DIR"
3437
cd "$TMP_DIR" || exit 1
3538

3639
# Download and extract
3740
echo "📦 Downloading from $ZIP_URL"
3841
wget -q "$ZIP_URL" -O latest.zip || curl -L "$ZIP_URL" -o latest.zip
3942
unzip -q latest.zip
4043

44+
# Check if the source directory exists
45+
SOURCE_DIR="$TMP_FOLDER/$TARGET_SUBFOLDER"
46+
if [ ! -d "$SOURCE_DIR" ]; then
47+
echo "❌ Source directory not found: $SOURCE_DIR"
48+
echo "Available directories in $TMP_FOLDER:"
49+
ls -la "$TMP_FOLDER/"
50+
exit 1
51+
fi
52+
4153
# Copy the integration folder to destination
4254
mkdir -p "$DEST_FOLDER"
4355
cp -r "$TMP_FOLDER/$TARGET_SUBFOLDER/"* "$DEST_FOLDER/"

0 commit comments

Comments
 (0)