mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-18 19:34:12 +03:00
23 lines
554 B
JavaScript
23 lines
554 B
JavaScript
|
#!/usr/bin/env node
|
||
|
/**
|
||
|
* @fileoverview
|
||
|
* Takes a brand name as argument and outputs the corresonding filename to
|
||
|
* standard output.
|
||
|
*/
|
||
|
|
||
|
const utils = require('./utils.js');
|
||
|
|
||
|
if (process.argv.length < 3) {
|
||
|
console.error("Provide a brand name as argument")
|
||
|
} else {
|
||
|
let brandName = "";
|
||
|
for (let i = 2; i < process.argv.length; i++) {
|
||
|
brandName += ` ${process.argv[i]}`;
|
||
|
}
|
||
|
|
||
|
brandName = brandName.substring(1);
|
||
|
|
||
|
const filename = utils.titleToFilename(brandName);
|
||
|
console.log(`For '${brandName}' use the filename '${filename}.svg'`);
|
||
|
}
|