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

21 lines
520 B
JavaScript
Raw Normal View History

2024-03-24 19:38:18 +02:00
#!/usr/bin/env node
/**
2024-06-06 14:40:35 +02:00
* @file
* Script that takes a brand name as argument and outputs the corresponding
* icon SVG filename to standard output.
*/
import process from 'node:process';
2024-03-24 19:38:18 +02:00
import {titleToSlug} from '../sdk.mjs';
if (process.argv.length < 3) {
console.error('Provide a brand name as argument');
process.exit(1);
} else {
2024-03-24 19:38:18 +02:00
const brandName = process.argv[2];
const filename = titleToSlug(brandName);
2024-05-02 22:54:43 +02:00
process.stdout.write(
`For '${brandName}' use the file 'icons/${filename}.svg'\n`,
);
}