@docyrus/logo-asset-generator
Version:
CLI tool to generate favicon and app icons from a source logo
28 lines (26 loc) • 1.21 kB
JavaScript
import {
generateAssets
} from "./chunk-YAKKFHGX.js";
// src/cli.ts
import path from "path";
import { Command } from "commander";
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.info("\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.info("\u2705 Successfully generated all assets and updated HTML meta tags!");
console.info(`\u{1F4C1} Assets saved to: ${outputDir || path.dirname(htmlPath)}`);
} catch (error) {
console.error("\u274C Error generating assets:", error);
process.exit(1);
}
});
program.parse();