1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-11-26 01:00:27 +02:00
simple-icons/scripts/get-filename.js

23 lines
554 B
JavaScript
Raw Normal View History

#!/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'`);
}