mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
02e2e402c3
As the title says, this commit is a massive overhaul. I've rewritten/restrucuted almost everything in the controller scripts. Because of that, there's a considerable possibility that I've broken something somewhere. Notable changes: Added temporary uploads. Removed file name length changer from dashboard, in favor of an equivalent in homepage config tab. This allows non-registered users to also set file name length. A bunch of other undocmented stuff. I don't know, I'm too tired to remember them all.
32 lines
935 B
JavaScript
32 lines
935 B
JavaScript
const { stripIndents } = require('./_utils')
|
|
const utils = require('./../controllers/utilsController')
|
|
|
|
;(async () => {
|
|
const location = process.argv[1].replace(process.cwd() + '/', '')
|
|
const args = process.argv.slice(2)
|
|
|
|
if (!args.length || args.includes('--help') || args.includes('-h'))
|
|
return console.log(stripIndents(`
|
|
Purge Cloudflare's cache.
|
|
|
|
Usage:
|
|
node ${location} ...filename
|
|
|
|
filename:
|
|
Upload names separated by space (will automatically include their thumbs if available).
|
|
`))
|
|
|
|
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}`))
|
|
else
|
|
console.log(`URLs:\n${result.files.join('\n')}\n\nSuccess: ${result.success}`)
|
|
})()
|
|
.then(() => process.exit(0))
|
|
.catch(error => {
|
|
console.error(error)
|
|
process.exit(1)
|
|
})
|