mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-17 19:04:13 +03:00
8ecfcafeba
- Rename `titleToFilename` to `titleToSlug` - Fix indentation where necessary - Use quotes internally consistently (to reduce the diff size, unfortunately this is the opposite quote from what we use in other projects) - Update comments & documentation - Construct file paths And more...
20 lines
542 B
JavaScript
20 lines
542 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.
|
|
*/
|
|
|
|
const utils = require("./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 = utils.titleToSlug(brandName);
|
|
console.log(`For '${brandName}' use the file 'icons/${filename}.svg'`);
|
|
}
|