{"size": 402, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "fisker/iconfont-update", "max_stars_repo_stars_event_min_datetime": "2022-01-17T02:40:30.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T02:40:30.000Z", "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "fisker/iconfont-update", "max_issues_repo_issues_event_min_datetime": "2018-10-18T07:10:57.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-13T17:21:42.000Z", "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "fisker/iconfont-update", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 52, "max_forks_count": null, "avg_line_length": 21.1578947368, "max_line_length": 72, "alphanum_fraction": 0.7039800995}
import Iconfont from './lib/iconfont'
import signale from './lib/signale'

export default async function download(config) {
  const iconfont = new Iconfont(config)

  const project = await iconfont.info()

  if (!project) {
    signale.fatal(new Error(`access project ${config.project} denied.`))
  }

  if (project.project.font_is_old) {
    await iconfont.update()
  }

  await iconfont.download()
}
