<commit_before>var s3 = require('s3');
var conf = require('./aws-credentials.json')
var pkg = require('../package.json')

console.log(pkg.version)

var client = s3.createClient({
  s3Options: conf
});

var destination = "files/calcite-web/" + "version-foo" + "/"

var versioned = {
  localDir: "./dist",
  s3Params: {
    ACL: "public-read",
    Bucket: "patterns.esri.com",
    Prefix: destination
  }
};

var latest = {
  localDir: "./dist",
  s3Params: {
    ACL: "public-read",
    Bucket: "patterns.esri.com",
    Prefix: "files/calcite-web/latest/"
  }
};

var uploader = client.uploadDir(versioned);

uploader.on('error', function(err) {
  console.error("unable to sync:", err.stack);
});

uploader.on('progress', function() {
  console.log("progress", uploader.progressAmount, uploader.progressTotal);
});

uploader.on('end', function() {
  console.log("done uploading");
});
<commit_msg>final s3 readyness<commit_after>var s3 = require('s3');
var conf = require('./aws-credentials.json')
var pkg = require('../package.json')

var client = s3.createClient({
  s3Options: conf
});

var destination = "files/calcite-web/" + pkg.version + "/"

var versioned = {
  localDir: "./dist",
  s3Params: {
    ACL: "public-read",
    Bucket: "patterns.esri.com",
    Prefix: destination
  }
};

var latest = {
  localDir: "./dist",
  s3Params: {
    ACL: "public-read",
    Bucket: "patterns.esri.com",
    Prefix: "files/calcite-web/latest/"
  }
};

var uploader = client.uploadDir(versioned);

uploader.on('error', function(err) {
  console.error("unable to sync:", err.stack);
});

uploader.on('progress', function() {
  console.log("progress", uploader.progressAmount, uploader.progressTotal);
});

uploader.on('end', function() {
  console.log("done uploading");
});


var latestUpload = client.uploadDir(latest);

uploader.on('error', function(err) {
  console.error("unable to sync:", err.stack);
});

uploader.on('progress', function() {
  console.log("progress", uploader.progressAmount, uploader.progressTotal);
});

uploader.on('end', function() {
  console.log("done uploading");
});
{'fraction_non_alphanumeric': 0.19168260038240917, 'fraction_numerical': 0.00621414913957935, 'mean_word_length': 4.2325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5024194', 'n_tokens_mistral': 737, 'n_tokens_neox': 720, 'n_words': 137}