<commit_before>// verify that prepublish runs on pack and publish
var test = require('tap').test
var npm = require('../../')
var fs = require('fs')
var pkg = __dirname + '/prepublish_package'
var tmp = pkg + '/tmp'
var cache = pkg + '/cache'
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var npm = require('npm')
var path = require('path')

test('setup', function (t) {
  var n = 0
  mkdirp(pkg, then())
  mkdirp(cache, then())
  mkdirp(tmp, then())
  function then (er) {
    n ++
    return function (er) {
      if (er)
        throw er
      if (--n === 0)
        next()
    }
  }

  function next () {
    fs.writeFile(pkg + '/package.json', JSON.stringify({
      name: 'npm-test-prepublish',
      version: '1.2.5',
      scripts: { prepublish: 'echo ok' }
    }), 'ascii', function (er) {
      if (er)<commit_msg>Fix duplicate variable causing test failure.<commit_after>// verify that prepublish runs on pack and publish
var test = require('tap').test
var npm = require('../../')
var fs = require('fs')
var pkg = __dirname + '/prepublish_package'
var tmp = pkg + '/tmp'
var cache = pkg + '/cache'
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var path = require('path')

test('setup', function (t) {
  var n = 0
  mkdirp(pkg, then())
  mkdirp(cache, then())
  mkdirp(tmp, then())
  function then (er) {
    n ++
    return function (er) {
      if (er)
        throw er
      if (--n === 0)
        next()
    }
  }

  function next () {
    fs.writeFile(pkg + '/package.json', JSON.stringify({
      name: 'npm-test-prepublish',
      version: '1.2.5',
      scripts: { prepublish: 'echo ok' }
    }), 'ascii', function (er) {
      if (er)
{'fraction_non_alphanumeric': 0.17458432304038005, 'fraction_numerical': 0.0059382422802850355, 'mean_word_length': 2.7361419068736144, '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': '5359125', 'n_tokens_mistral': 594, 'n_tokens_neox': 566, 'n_words': 175}