UNPKG

@docyrus/logo-asset-generator

Version:

CLI tool to generate favicon and app icons from a source logo

28 lines (26 loc) 1.21 kB
#!/usr/bin/env node import { generateAssets } from "./chunk-SQUENTTE.js"; // src/cli.ts import { Command } from "commander"; import path from "path"; var program = new Command(); program.name("logo-asset-generator").description("Generate favicon and app icons from a source logo").version("0.0.1").requiredOption("-l, --logo <path>", "Path or URL to the 512x512px logo (PNG or SVG)").requiredOption("-i, --index <path>", "Path to the index.html file to update").option("-o, --output <path>", "Output directory for generated assets (defaults to same directory as index.html)").action(async (options) => { try { console.log("\u{1F3A8} Starting logo asset generation..."); const htmlPath = path.resolve(options.index); const outputDir = options.output ? path.resolve(options.output) : void 0; await generateAssets({ logoPath: options.logo, htmlPath, outputDir }); console.log("\u2705 Successfully generated all assets and updated HTML meta tags!"); console.log(`\u{1F4C1} Assets saved to: ${outputDir || path.dirname(htmlPath)}`); } catch (error) { console.error("\u274C Error generating assets:", error); process.exit(1); } }); program.parse();