<commit_before>require('dotenv').config()
pkg = require('../package.json')
version = require('./version')
path = require('path')

Bluebird = require('bluebird')
github = require('./github')

process.exit() if process.env.CI_PULL_REQUEST

if process.env.CIRCLE_TAG && "v#{pkg.version}" != process.env.CIRCLE_TAG
  console.log("Building tag #{process.env.CIRCLE_TAG}, but package version is #{pkg.version}")
  process.exit(1)

if process.env.CIRCLE_BRANCH.startsWith('@')
  console.log("Not releasing #{process.env.CIRCLE_BRANCH}")
  process.exit(1)

if process.env.CIRCLE_BRANCH.startsWith('nr-')

do Bluebird.coroutine(->
  console.log('finding releases')
  release = {
    static: 'static-files',
    current: "v#{pkg.version}",
    builds: 'builds',
  }

  for id, tag of release
    try
      release[id] = yield github("/releases/tags/#{tag}")
      console.log("#{tag} found")

  xpi = "zotero-better-bibtex-#{version}.xpi"

  if process.env.CIRCLE_TAG
    if release.current

do Bluebird.coroutine(->
  console.log('finding releases')
  release = {
    static: 'static-files',
    current: "v#{pkg.version}",
    builds: 'builds',
  }
<commit_msg>release<commit_after>require('dotenv').config()
pkg = require('../package.json')
version = require('./version')
path = require('path')

Bluebird = require('bluebird')
github = require('./github')

process.exit() if process.env.CI_PULL_REQUEST

if process.env.CIRCLE_TAG && "v#{pkg.version}" != process.env.CIRCLE_TAG
  console.log("Building tag #{process.env.CIRCLE_TAG}, but package version is #{pkg.version}")
  process.exit(1)

if process.env.CIRCLE_BRANCH.startsWith('@')
  console.log("Not releasing #{process.env.CIRCLE_BRANCH}")
  process.exit(1)

do Bluebird.coroutine(->
  console.log('finding releases')
  release = {
    static: 'static-files',
    current: "v#{pkg.version}",
    builds: 'builds',
  }

{'fraction_non_alphanumeric': 0.17782538832351366, 'fraction_numerical': 0.0021424745581146223, 'mean_word_length': 4.446064139941691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2189861', 'n_tokens_mistral': 656, 'n_tokens_neox': 662, 'n_words': 118}