<commit_before>// Download and unzip Sauce-Connect.jar to thirdparty directory.
// means we no longer need to bundle the large binary with this.

var fs = require('fs')
var path = require('path')
var request = require('request')
var unzip = require('unzip')

var SAUCE_CONNECT_URL = 'http://saucelabs.com/downloads/Sauce-Connect-latest.zip'

console.log("Downloading Sauce-Connect.jar from SauceLabs...")
request(SAUCE_CONNECT_URL)
  .pipe(unzip.Parse())
  .on('entry', function(entry) {
    if (entry.path === 'Sauce-Connect.jar') {
      entry.pipe(fs.createWriteStream(path.join(__dirname, 'thirdparty', entry.path)))
    } else {
      entry.autodrain()
    }
  })
<commit_msg>install.js: only download Sauce-Connect if missing<commit_after>// Download and unzip Sauce-Connect.jar to thirdparty directory.
// means we no longer need to bundle the large binary with this.

var fs = require('fs')
var path = require('path')
var request = require('request')
var unzip = require('unzip')

var SAUCE_CONNECT_URL = 'http://saucelabs.com/downloads/Sauce-Connect-latest.zip'
var jarName = 'Sauce-Connect.jar'
var jarPath = path.join(__dirname, 'thirdparty', jarName)

if (fs.existsSync(jarPath)) {
  console.log("Sauce Connect already downloaded to "+jarPath)
} else {
  console.log("Downloading Sauce-Connect.jar from SauceLabs...")
  request(SAUCE_CONNECT_URL)
  .pipe(unzip.Parse())
  .on('entry', function(entry) {
    if (entry.path === jarName) {
      entry.pipe(fs.createWriteStream(jarPath))
    } else {
      entry.autodrain()
    }
  })
}

{'fraction_non_alphanumeric': 0.14414996767937943, 'fraction_numerical': 0.0, 'mean_word_length': 4.22972972972973, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7334862', 'n_tokens_mistral': 519, 'n_tokens_neox': 512, 'n_words': 122}