UNPKG

aws-cloudfront-invalidator

Version:

A CLI tool that invalidates CloudFront distributions based on the S3 origin

17 lines (13 loc) 464 B
#!/usr/bin/env node const program = require('commander') const cloudfront = require('./src/cloudfront') program .version('1.0.0') .option('-b, --bucket [bucket]', 'Name of S3 Bucket to invalidate') .parse(process.argv) program.bucket.length ? (() => { const buckets = process.argv.splice(3) buckets.forEach(async e => await cloudfront.invalidateBucket((e))) })() : (() => { throw new Error('No S3 Bucket(s) provided') })()