21 lines · 1.0 KB · TypeScriptRaw
// Copies CottonUI's canonical photographed paper surfaces into Android without resampling.// Run with: pnpm exec tsx apps/cotton-android/scripts/derive-paper-assets.tsimport { copyFileSync, mkdirSync } from "node:fs";import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";const androidDir = join(dirname(fileURLToPath(import.meta.url)), "..");const repoRoot = join(androidDir, "..", "..");const source = join(repoRoot, "apps", "cotton", "Sources", "CottonUI", "Media.xcassets");const destination = join(androidDir, "app", "src", "main", "res", "drawable-nodpi");const names = ["paper-pink", "paper-cream", "paper-sage", "paper-blue", "paper-straw", "paper-peach", "paper-grain"];export function derivePaperAssets(): void { mkdirSync(destination, { recursive: true }); for (const name of names) { copyFileSync(join(source, `${name}.imageset`, `${name}.png`), join(destination, `${name.replaceAll("-", "_")}.png`)); }}if (process.argv[1] === fileURLToPath(import.meta.url)) derivePaperAssets();