await writeFile()

in libs/@guardian/source/scripts/create-icons/index.ts [60:88]


	await writeFile(
		path.resolve(VENDOR_ICON_PATH, 'README.md'),
		createReadme(),
		'utf8',
	);

	console.log('Getting SVGs from Figma');

	const icons = await getIconsFromFigma();

	console.log(`Creating components`);

	// fetch the SVGs from Figma, create a react component from them using svgr
	// and save them both
	for (const icon of icons) {
		const { component, componentName } = await createIconComponent({
			icon,
			retainFill: SPECIAL_CASES.retainFill.includes(icon.name),
			isWideIcon: SPECIAL_CASES.isWide.includes(icon.name),
		});

		const filepath = path.resolve(VENDOR_ICON_PATH, `${componentName}.tsx`);

		await writeFile(
			filepath,
			await format(warning + component, { filepath, ...prettierConfig }),
			'utf8',
		);
	}