2020-02-26 18:54:54 +02:00
|
|
|
/**
|
|
|
|
* @fileoverview
|
2021-02-08 18:14:31 +02:00
|
|
|
* Script that takes a brand name as argument and outputs the corresponding
|
|
|
|
* icon SVG filename to standard output.
|
2020-02-26 18:54:54 +02:00
|
|
|
*/
|
|
|
|
|
2023-08-08 06:38:52 +02:00
|
|
|
import process from 'node:process';
|
2023-04-19 15:23:13 +02:00
|
|
|
import { titleToSlug } from '../sdk.mjs';
|
2020-02-26 18:54:54 +02:00
|
|
|
|
|
|
|
if (process.argv.length < 3) {
|
2021-10-25 21:13:10 +02:00
|
|
|
console.error('Provide a brand name as argument');
|
2021-02-08 18:14:31 +02:00
|
|
|
process.exit(1);
|
2020-02-26 18:54:54 +02:00
|
|
|
} else {
|
2021-10-25 21:13:10 +02:00
|
|
|
const brandName = process.argv
|
|
|
|
.slice(3)
|
2021-02-08 18:14:31 +02:00
|
|
|
.reduce((acc, arg) => `${acc} ${arg}`, process.argv[2]);
|
2020-02-26 18:54:54 +02:00
|
|
|
|
2021-02-22 15:15:37 +02:00
|
|
|
const filename = titleToSlug(brandName);
|
2021-02-08 18:14:31 +02:00
|
|
|
console.log(`For '${brandName}' use the file 'icons/${filename}.svg'`);
|
2020-02-26 18:54:54 +02:00
|
|
|
}
|