Skip to content

Check_assets

FieldValue
TypeSkill Resource
Source~/.copilot/skills/generators/scripts/check_assets.py
DescriptionNot specified

Source Content

#!/usr/bin/env python3
"""Check generated logo assets against an expected manifest.
Usage: check_assets.py <output-dir> <manifest.json>
manifest.json is a JSON list of expected relative paths, e.g.:
["favicon-32.png", "favicon-96.png", "favicon.ico", "apple-touch-icon-180.png"]
Fails if any expected file is missing, or is present but zero bytes.
"""
import json
import sys
from pathlib import Path
def main() -> int:
if len(sys.argv) != 3:
print("Usage: check_assets.py <output-dir> <manifest.json>", file=sys.stderr)
return 2
out_dir = Path(sys.argv[1])
manifest = json.loads(Path(sys.argv[2]).read_text(encoding="utf-8"))
fail = 0
for rel_path in manifest:
p = out_dir / rel_path
if not p.exists():
print(f"❌ missing expected asset: {rel_path}")
fail = 1
elif p.stat().st_size == 0:
print(f"❌ asset exists but is zero bytes: {rel_path}")
fail = 1
else:
print(f"✅ {rel_path} ({p.stat().st_size} bytes)")
return fail
if __name__ == "__main__":
raise SystemExit(main())