Browse Source

add download-resources script

Yuki Takei 7 years ago
parent
commit
89eacca69e
1 changed files with 22 additions and 0 deletions
  1. 22 0
      bin/download-resources.js

+ 22 - 0
bin/download-resources.js

@@ -0,0 +1,22 @@
+/**
+ * the tool for download CDN resources and save as file
+ *
+ * @author Yuki Takei <yuki@weseek.co.jp>
+ */
+
+require('module-alias/register');
+
+const logger = require('@alias/logger')('growi:bin:download-resources');
+const CdnResourcesResolver = require('@commons/service/cdn-resources-resolver');
+
+const resolver = new CdnResourcesResolver();
+
+logger.info('Start to download.');
+
+resolver.downloadAndWriteAll()
+  .then(() => {
+    logger.info('Download is terminated successfully');
+  })
+  .catch(err => {
+    logger.error(err);
+  });