UNPKG

@swift-ws/gulp-kit

Version:

A starter kit for automating frontend development using Gulp.js.

24 lines (20 loc) 789 B
import {GetGoogleFonts} from '../plugins.js'; import {join} from 'path'; const download = (config, family, link) => { const ggf = new GetGoogleFonts({ outputDir: join(config.dest, config.tasks.googleFonts.outputDir.replace('{_family}', family)), path: config.tasks.googleFonts.path.replace('{_family}', family), template: config.tasks.googleFonts.template, }); return ggf.download(link).then(() => { //console.log('Done!') }); } export const getGoogleFonts = async () => { const {config} = await import('../config.js'); if (config.tasks.googleFonts.hasOwnProperty('list')) { for (const [family, link] of Object.entries(config.tasks.googleFonts.list)) { await download(config, family, link); } } };