<commit_before>// Packages
const {write: copy} = require('clipboardy')
const ip = require('ip')
const pathType = require('path-type')
const chalk = require('chalk')
const boxen = require('boxen')
const {coroutine} = require('bluebird')

module.exports = coroutine(function * (server, current, inUse, clipboard) {
  const details = server.address()
  const isTTY = process.stdout.isTTY

  process.on('SIGINT', () => {
    server.close()
    process.exit(0)
  })

  let isDir

  try {
    isDir = yield pathType.dir(current)
  } catch (err) {
    isDir = false
  }

  if (!isDir) {
    console.error(chalk.red('Specified directory doesn\'t exist!'))
    process.exit(1)
  }

  if (process.env.NODE_ENV !== 'production') {
    let message = chalk.green('Serving!')

    if (inUse) {
      message += ' ' + chalk.red(`(on port ${inUse.open},` +
      ` because ${inUse.old} is already in use)`)
    }<commit_msg>Indicate name of directory that doesn't exist<commit_after>// Native
const {basename} = require('path')

// Packages
const {write: copy} = require('clipboardy')
const ip = require('ip')
const pathType = require('path-type')
const chalk = require('chalk')
const boxen = require('boxen')
const {coroutine} = require('bluebird')

module.exports = coroutine(function * (server, current, inUse, clipboard) {
  const details = server.address()
  const isTTY = process.stdout.isTTY

  process.on('SIGINT', () => {
    server.close()
    process.exit(0)
  })

  let isDir

  try {
    isDir = yield pathType.dir(current)
  } catch (err) {
    isDir = false
  }

  if (!isDir) {
    const base = basename(current)

    console.error(chalk.red(`Specified directory ${chalk.bold(`"${base}"`)} doesn't exist!`))
    process.exit(1)
  }

  if (process.env.NODE_ENV !== 'production') {
    let message = chalk.green('Serving!')

    if (inUse) {
      message += ' ' + chalk.red(`(on port ${inUse.open},` +
      ` because ${inUse.old} is already in use)`)
    }
{'fraction_non_alphanumeric': 0.16717791411042945, 'fraction_numerical': 0.002044989775051125, 'mean_word_length': 3.5511627906976746, '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': '716521', 'n_tokens_mistral': 679, 'n_tokens_neox': 660, 'n_words': 156}