download-resources.js 532 B

12345678910111213141516171819202122
  1. /**
  2. * the tool for download CDN resources and save as file
  3. *
  4. * @author Yuki Takei <yuki@weseek.co.jp>
  5. */
  6. require('module-alias/register');
  7. const logger = require('@alias/logger')('growi:bin:download-resources');
  8. const CdnResourcesService = require('@commons/service/cdn-resources-service');
  9. const service = new CdnResourcesService();
  10. logger.info('Start to download.');
  11. service.downloadAndWriteAll()
  12. .then(() => {
  13. logger.info('Download is terminated successfully');
  14. })
  15. .catch(err => {
  16. logger.error(err);
  17. });