import __SSugarConfig from '@coffeekraken/s-sugar-config'; import { __copySync, __dirname } from '@coffeekraken/sugar/fs'; import { __packageRootDir } from '@coffeekraken/sugar/path'; import __path from 'path'; import type { ISKitchenIngredient } from '../../SKitchen.js'; /** * @name faviconIngredient * @namespace node.ingredients.frontspec * @type ISKitchenIngredient * @static * * This ingredient represent the "frontspec.json" file at the root of your project * * @since 2.0.0 * @author Olivier Bossel (https://coffeekraken.io) */ const faviconIngredient: ISKitchenIngredient = { id: 'favicon', description: 'Add the base favicon.png file into your sugar project', projectTypes: ['unknown', 'sugar'], async add() { // source file path const sourceFilePath = __path.resolve( __packageRootDir(__dirname()), `src/data/favicon/favicon.png`, ); const output = __SSugarConfig.get('faviconBuilder.input'); // copy the file to his destination __copySync(sourceFilePath, output); return true; }, }; export default faviconIngredient;