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