Files
light_preset_manager/frontend/scripts/copy.js
T
angeandClaude Opus 5.5 2a8ba5105a Mise en conformité a2m (type homeassistant-integration) et compatibilité Home Assistant 2026
- Carte servie et chargée par l'intégration (plus de copie dans www/ ni de ressource Lovelace)
- Température de couleur en kelvins (ATTR_COLOR_TEMP supprimé de HA 2026.1), anciens préréglages convertis
- get_presets déclarée avec réponse
- manifest (URLs, dépendances), hacs.json, icône, .a2m/type_attributes.toml, scripts/package.py
- README et CHANGELOG FR/EN, LICENSE MIT, CLAUDE.md et skill de publication
- Fichiers de Home Assistant de dev retirés du suivi, .gitignore revu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 13:37:27 +02:00

37 lines
1.3 KiB
JavaScript

// =============================================================================
// COPY SCRIPT
// =============================================================================
// Copies the built JS file to all required locations:
// 1. custom_components/.../frontend/ → For HACS distribution
// (served by the integration itself, also in the dev Home Assistant: no copy to www/)
const fs = require('fs');
const path = require('path');
// Source: where esbuild outputs the compiled file
const SOURCE = path.resolve(__dirname, '../dist/light-preset-manager.js');
// Targets: where we need to copy the file
const TARGETS = [
// Production location (HACS will use this)
path.resolve(__dirname, '../../custom_components/light_preset_manager/frontend/light-preset-manager.js'),
];
// Ensure each target directory exists, then copy
for (const target of TARGETS) {
const dir = path.dirname(target);
// Create directory if it doesn't exist
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
console.log(`📁 Created directory: ${dir}`);
}
// Copy the file
try {
fs.copyFileSync(SOURCE, target);
console.log(`✅ Copied to: ${path.relative(process.cwd(), target)}`);
} catch (err) {
console.error(`❌ Failed: ${err.message}`);
}
}