#!/usr/bin/env python3 """Склеивает CSS/JS в единый index.html для деплоя (scp на германскую ВМ).""" import os BASE = os.path.dirname(os.path.abspath(__file__)) html = open(os.path.join(BASE, 'index.html')).read() css = open(os.path.join(BASE, 'css/style.css')).read() html = html.replace('', f'') for jsf in ['storage.js', 'syllables.js', 'transcribe.js', 'audio.js', 'compare.js', 'main.js']: js = open(os.path.join(BASE, 'js', jsf)).read() html = html.replace(f'', f'') os.makedirs(os.path.join(BASE, 'dist'), exist_ok=True) with open(os.path.join(BASE, 'dist/index.html'), 'w') as f: f.write(html) print(f'dist/index.html ready ({len(html)} bytes)')