From aab62b6bfe45c60966efbd46879ffce08dfefaf5 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Thu, 31 Jan 2019 16:49:14 +0700 Subject: [PATCH] Updated cfpurge.js and thumbs.js Sigh. --- scripts/cfpurge.js | 2 +- scripts/thumbs.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/cfpurge.js b/scripts/cfpurge.js index 512949f..4afae63 100644 --- a/scripts/cfpurge.js +++ b/scripts/cfpurge.js @@ -16,7 +16,7 @@ cfpurge.do = async () => { Upload names separated by space (will automatically include their thumbs if available). `)) - const results = await utils.purgeCloudflareCache(args, true) + const results = await utils.purgeCloudflareCache(args, true, true) for (const result of results) if (result.errors.length) result.errors.forEach(error => console.error(`CF: ${error}`)) diff --git a/scripts/thumbs.js b/scripts/thumbs.js index 7e9cb6f..08f325d 100644 --- a/scripts/thumbs.js +++ b/scripts/thumbs.js @@ -99,7 +99,10 @@ thumbs.do = async () => { if (thumbs.cfcache && succeeded.length) { console.log('Purging Cloudflare\'s cache...') - const results = await utils.purgeCloudflareCache(succeeded.map(n => `thumbs/${n}`), true, false) + const results = await utils.purgeCloudflareCache(succeeded.map(name => { + const extname = utils.extname(name) + return `thumbs/${name.slice(0, -extname.length)}.png` + }), true, false) for (let i = 0; i < results.length; i++) { if (results[i].errors.length) results[i].errors.forEach(error => console.error(`CF: ${error}`))