mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-16 18:34:12 +03:00
a930dc57ec
* convert scripts to esm * fix tests * fix tests * fix lints * syncFs to fsSync * named export for fs Co-authored-by: LitoMore <LitoMore@users.noreply.github.com> * fsSync to { promises as fs } * convert update-svgs-count to esm * rename data to icons * fix build script * switch svglintrc file to mjs * use node: protocol * pluralize getIcons Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>
21 lines
546 B
JavaScript
21 lines
546 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* @fileoverview
|
|
* Script that takes a brand name as argument and outputs the corresponding
|
|
* icon SVG filename to standard output.
|
|
*/
|
|
|
|
import { titleToSlug } from './utils.js';
|
|
|
|
if (process.argv.length < 3) {
|
|
console.error('Provide a brand name as argument');
|
|
process.exit(1);
|
|
} else {
|
|
const brandName = process.argv
|
|
.slice(3)
|
|
.reduce((acc, arg) => `${acc} ${arg}`, process.argv[2]);
|
|
|
|
const filename = titleToSlug(brandName);
|
|
console.log(`For '${brandName}' use the file 'icons/${filename}.svg'`);
|
|
}
|