2024-03-24 19:38:18 +02:00
|
|
|
#!/usr/bin/env node
|
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';
|
2024-03-24 19:38:18 +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 {
|
2024-03-24 19:38:18 +02:00
|
|
|
const brandName = process.argv[2];
|
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
|
|
|
}
|