mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-26 01:00:27 +02: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'`);
|
||
|
}
|