mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
98e6c59255
changed reporter formatter for gulp stylelint from verbose to string this should now only print out issues to console linted other server-side JS files that i missed out on previous commits bumped versions.js to trigger github actions
34 lines
920 B
JavaScript
34 lines
920 B
JavaScript
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(utils.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)
|
|
})
|