PulseCanvas / app · pulsecanvas.ai / scripts / prepare-store-resources.sh
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | cd "$(dirname "$0")/.." |
| 4 | # Recreate the store payload; projectM code, presets, textures and updater never enter it. |
| 5 | rm -rf .build/store-resources/Resources .build/store-resources/Legal |
| 6 | mkdir -p .build/store-resources/Legal |
| 7 | python3 - <<'PY' |
| 8 | from pathlib import Path |
| 9 | import shutil |
| 10 | source = Path('Sources/PulseCanvas/Resources') |
| 11 | target = Path('.build/store-resources/Resources') |
| 12 | target.mkdir(parents=True) |
| 13 | for item in source.iterdir(): |
| 14 | if item.name == 'ProjectM': |
| 15 | continue |
| 16 | if item.is_dir(): |
| 17 | shutil.copytree(item, target / item.name) |
| 18 | else: |
| 19 | shutil.copy2(item, target / item.name) |
| 20 | PY |
| 21 | xcrun swift scripts/build-icon.swift .build/store-resources/AppIcon.iconset |
| 22 | xcrun iconutil -c icns .build/store-resources/AppIcon.iconset -o .build/store-resources/AppIcon.icns |
| 23 | cp LICENSE .build/store-resources/Legal/PulseCanvas-LICENSE.txt |
| 24 | cp docs/app-store/ZIPFoundation-LICENSE.txt .build/store-resources/Legal/ZIPFoundation-LICENSE.txt |
| 25 | python3 scripts/native-visualizer-catalog.py --output .build/store-resources/Resources/NativeVisualizers.json |
| 26 | python3 - <<'PY' |
| 27 | import json |
| 28 | from pathlib import Path |
| 29 | count = json.loads(Path('.build/store-resources/Resources/NativeVisualizers.json').read_text())['activeCount'] |
| 30 | Path('.build/store-resources/Legal/Edition.txt').write_text(f'PulseCanvas Studio — Metal edition\n{count} native Metal visualizers. No projectM engine, OpenGL presets, community texture pack or Sparkle updater is included in this App Store build.\n') |
| 31 | PY |