30 lines
887 B
JavaScript
30 lines
887 B
JavaScript
// generate-assets.js
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
// Minimal valid PNG buffer (1x1 solid block)
|
|
const minimalPngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
|
|
const pngBuffer = Buffer.from(minimalPngBase64, "base64");
|
|
|
|
const assetPaths = [
|
|
"imgs/plugin/category.png",
|
|
"imgs/plugin/category@2x.png",
|
|
"imgs/actions/app-slot.png",
|
|
"imgs/actions/app-slot@2x.png",
|
|
"imgs/actions/app-slot-state.png",
|
|
"imgs/actions/app-slot-state@2x.png"
|
|
];
|
|
|
|
for (const relativePath of assetPaths) {
|
|
const fullPath = path.join(process.cwd(), relativePath);
|
|
const dir = path.dirname(fullPath);
|
|
|
|
if (!fs.existsSync(dir)) {
|
|
fs.mkdirSync(dir, { recursive: true });
|
|
}
|
|
|
|
fs.writeFileSync(fullPath, pngBuffer);
|
|
console.log(`Created: ${relativePath}`);
|
|
}
|
|
|
|
console.log("\nPlaceholder assets created successfully."); |