diff options
Diffstat (limited to 'exampleSite/plugins/netlify-plugin-hugo-cache-resources/index.js')
-rw-r--r-- | exampleSite/plugins/netlify-plugin-hugo-cache-resources/index.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/exampleSite/plugins/netlify-plugin-hugo-cache-resources/index.js b/exampleSite/plugins/netlify-plugin-hugo-cache-resources/index.js deleted file mode 100644 index fd8ffb6..0000000 --- a/exampleSite/plugins/netlify-plugin-hugo-cache-resources/index.js +++ /dev/null @@ -1,39 +0,0 @@ -const getResourcesDir = () => { - return 'exampleSite/resources'; -} - -const printList = (items) => { - console.log('---'); - items.forEach((item, index) => { - console.log(`${index + 1}. ${item}`); - }); -} - -module.exports = { - - async onPreBuild({ utils, inputs }) { - const path = getResourcesDir(); - const success = await utils.cache.restore(path); - - if (success) { - const cachedFiles = await utils.cache.list(path); - console.log(`Restored cached resources folder. Total files: ${cachedFiles.length}`); - if (inputs.debug) printList(cachedFiles); - } else { - console.log(`No cache found for resources folder`); - } - }, - - async onPostBuild({ utils, inputs }) { - const path = getResourcesDir(); - const success = await utils.cache.save(path); - - if (success) { - const cachedFiles = await utils.cache.list(path); - console.log(`Saved resources folder to cache. Total files: ${cachedFiles.length}`); - if (inputs.debug) printList(cachedFiles); - } else { - console.log(`No resources folder cached`); - } - } -};
\ No newline at end of file |