methods/util/verifyAWS.js
// verifies  that the bucket exists and create if otherwise
verifies  that the bucket exists and create if otherwise
verifies that the bucket exists and create if otherwise
async function verifyBucket(bucket, create = false) {
  if (bucket !== bucket.toLowerCase()) {
    console.log(fail('  AWS S3 buckets must be in lower case only'));
    return;
  }
  const verifyResult = await s3.verifyBucket(bucket);
  verifyResult ? console.log(finished('  Bucket exists\n')) : console.log(fail('  Bucket doesn\'t exist\n'));
  if (create && !verifyResult) await s3.createBucket(bucket);
}
async function verifyBucket ( bucket , create = false ) { if ( bucket !== bucket . toLowerCase ( ) ) { console . log ( fail ( '  AWS S3 buckets must be in lower case only' ) ) ; return ; } const verifyResult = await s3 . verifyBucket ( bucket ) ; verifyResult ? console . log ( finished ( '  Bucket exists\n' ) ) : console . log ( fail ( '  Bucket doesn\'t exist\n' ) ) ; if ( create && ! verifyResult ) await s3 . createBucket ( bucket ) ; }
verifies  that the bucket exists and create if otherwise
verifies that the bucket exists and create if otherwise