hass.tibber_prices/scripts/sync-hacs
Julian Pawlowski 60c3b72932 chore(dev): add HACS installation and sync scripts for testing
Added scripts to install HACS in DevContainer for testing the
integration alongside other HACS components.

Changes:
- scripts/setup: Automatically install HACS and create symlink
- scripts/sync-hacs: Sync HACS-installed integrations via symlinks
- .gitignore: Ignore custom_components/* except tibber_prices

HACS installs to config/custom_components/, symlinks in
custom_components/ make integrations visible to Home Assistant.

Impact: Developers can test with other integrations. No user changes.
2025-11-16 18:05:14 +00:00

39 lines
1 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# script/sync-hacs: Sync HACS-installed integrations to custom_components/
set -e
cd "$(dirname "$0")/.."
echo "==> Syncing HACS-installed integrations..."
# Check if config/custom_components exists
if [ ! -d "config/custom_components" ]; then
echo " No config/custom_components directory found"
exit 0
fi
# Create symlinks for all integrations in config/custom_components/
# except those that already exist in custom_components/
synced=0
for dir in config/custom_components/*/; do
component=$(basename "$dir")
target="custom_components/$component"
# Skip if already exists and is not a symlink (don't touch tibber_prices)
if [ -e "$target" ] && [ ! -L "$target" ]; then
continue
fi
# Create or update symlink
ln -sf "${PWD}/config/custom_components/$component" "$target"
echo " ✓ Linked: $component"
synced=$((synced + 1))
done
if [ $synced -eq 0 ]; then
echo " No new integrations to sync"
else
echo " ✓ Synced $synced integration(s)"
fi