#!/usr/bin/env bash # Copies the category icons from the locally installed 木木记账 into a data # directory (default: server/data/mumu-icons), or to the server with HOST set. # The icons stay private: they are never committed or baked into the image. # # deploy/extract-mumu-icons.sh # local dev # HOST=root@8.133.23.131 deploy/extract-mumu-icons.sh # server set -euo pipefail APP=${APP:-"/Applications/木木记账.app"} SRC="$APP/Contents/Frameworks/App.framework/Versions/A/Resources/flutter_assets/assets" cd "$(dirname "$0")/.." for s in 3d flat filled lineal outline; do test -d "$SRC/$s" || { echo "missing $SRC/$s"; exit 1; }; done if [ -n "${HOST:-}" ]; then tar -C "$SRC" -czf - 3d flat filled lineal outline | ssh "$HOST" 'mkdir -p /opt/billing/data/mumu-icons && tar -C /opt/billing/data/mumu-icons -xzf -' else mkdir -p server/data/mumu-icons tar -C "$SRC" -cf - 3d flat filled lineal outline | tar -C server/data/mumu-icons -xf - fi echo "icons copied"