mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-22 16:29:29 +00:00
18 lines
562 B
Python
18 lines
562 B
Python
import os
|
|
import sys
|
|
import shutil
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
|
|
sys.path.append(os.path.dirname(__file__))
|
|
from inline_resources import generate_inlined_css
|
|
|
|
class CustomBuildHook(BuildHookInterface):
|
|
def initialize(self, version: str, build_data: dict[str, Any]):
|
|
generate_inlined_css()
|
|
src = Path(self.root) / 'resources' / 'styles' / 'main.css'
|
|
dst = Path(self.root) / 'cloudflare_error_page' / 'templates'
|
|
shutil.copy(src, dst)
|