<commit_before>#!/usr/bin/env node

/**
 * Set the title.
 */

process.title = 'node-gyp'

/**
 * Module dependencies.
 */

var gyp = require('../')
var log = require('npmlog')

/**
 * Process and execute the selected commands.
 */

var prog = gyp()
prog.parseArgv(process.argv)

if (prog.todo.length === 0) {
  return prog.usageAndExit()
}

log.info('it worked if it ends with', 'ok')
log.info('using', 'node-gyp@%s', prog.version)
log.info('using', 'node@%s', process.versions.node)


/**
 * Change dir if -C/--directory was passed.
 */

var dir = prog.opts.directory
if (dir) {
  var fs = require('fs')
  try {
    var stat = fs.statSync(dir)
    if (stat.isDirectory()) {
      log.info('chdir', dir)
      process.chdir(dir)
    } else {
      log.warn('chdir', dir + ' is not a directory')
    }
  } catch (e) {
    if (e.code === 'ENOENT') {
      log.warn('chdir', dir + ' is not a directory')
    } else {
      log.warn('chdir', 'error during chdir() "%s"', e.message)
    }
  }
}

// start running the given commands!
var completed = false
run()

function run () {
  if (prog.todo.length === 0) {
    // done!
    completed = true
    log.info('done', 'ok')
    return
  }
  var command = prog.todo.shift()

  // is this an alias?
  if (command in prog.aliases) {
    command = prog.aliases[command]
  }

  prog.commands[command](prog.argv.slice(), function (err) {
    if (err) {
      log.error(command + ' error', err.stack)
      log.error('not ok')
      return process.exit(1)
    }
    if (command == 'list') {
      var versions = arguments[1]
      if (versions.length > 0) {
        versions.forEach(function (version) {<commit_msg>match npm's output for the done "ok" log message<commit_after>#!/usr/bin/env node

/**
 * Set the title.
 */

process.title = 'node-gyp'

/**
 * Module dependencies.
 */

var gyp = require('../')
var log = require('npmlog')

/**
 * Process and execute the selected commands.
 */

var prog = gyp()
prog.parseArgv(process.argv)

if (prog.todo.length === 0) {
  return prog.usageAndExit()
}

log.info('it worked if it ends with', 'ok')
log.info('using', 'node-gyp@%s', prog.version)
log.info('using', 'node@%s', process.versions.node)


/**
 * Change dir if -C/--directory was passed.
 */

var dir = prog.opts.directory
if (dir) {
  var fs = require('fs')
  try {
    var stat = fs.statSync(dir)
    if (stat.isDirectory()) {
      log.info('chdir', dir)
      process.chdir(dir)
    } else {
      log.warn('chdir', dir + ' is not a directory')
    }
  } catch (e) {
    if (e.code === 'ENOENT') {
      log.warn('chdir', dir + ' is not a directory')
    } else {
      log.warn('chdir', 'error during chdir() "%s"', e.message)
    }
  }
}

// start running the given commands!
var completed = false
run()

function run () {
  if (prog.todo.length === 0) {
    // done!
    completed = true
    log.info('ok')
    return
  }
  var command = prog.todo.shift()

  // is this an alias?
  if (command in prog.aliases) {
    command = prog.aliases[command]
  }

  prog.commands[command](prog.argv.slice(), function (err) {
    if (err) {
      log.error(command + ' error', err.stack)
      log.error('not ok')
      return process.exit(1)
    }
    if (command == 'list') {
      var versions = arguments[1]
      if (versions.length > 0) {
        versions.forEach(function (version) {
{'fraction_non_alphanumeric': 0.177017701770177, 'fraction_numerical': 0.003000300030003, 'mean_word_length': 2.623913043478261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6293878', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1174, 'n_words': 301}