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}`))