<commit_before>/*eslint no-console: 0 */
// @flow

import fs from 'fs'
import {join} from 'path'
import chalk from 'chalk'
import WorkingDirectory from '../lib/working-directory'
import AutoreleaseYml from '../lib/autorelease-yml'
import CircleYml from '../lib/circle-yml'

export default function run() {

    const rootDir = new WorkingDirectory().resolve()

    const arYml = AutoreleaseYml.loadFromDir(rootDir)

    arYml.checkFormat()

    const ymlStr = CircleYml.generate(arYml) 

    const filename = join(rootDir, 'circle.yml')

    if (process.env.DRY_RUN) {
        console.log(chalk.green('[DRY RUN] generating circle.yml'))
        console.log(chalk.green(ymlStr))
    }
    else {
        fs.writeFileSync(filename, ymlStr)
    }

    console.log(chalk.green('circle.yml was successfully generated!'))
}

if (require.main === module) run()<commit_msg>show what to do next in nca-generate<commit_after>/*eslint no-console: 0 */
// @flow

import fs from 'fs'
import {join} from 'path'
import chalk from 'chalk'
import WorkingDirectory from '../lib/working-directory'
import AutoreleaseYml from '../lib/autorelease-yml'
import CircleYml from '../lib/circle-yml'

export default function run() {

    const rootDir = new WorkingDirectory().resolve()

    const arYml = AutoreleaseYml.loadFromDir(rootDir)

    arYml.checkFormat()

    const ymlStr = CircleYml.generate(arYml) 

    const filename = join(rootDir, 'circle.yml')

    if (process.env.DRY_RUN) {
        console.log(chalk.green('[DRY RUN] generating circle.yml'))
        console.log(chalk.green(ymlStr))
    }
    else {
        fs.writeFileSync(filename, ymlStr)
    }

    console.log(chalk.green('circle.yml was successfully generated!'))
    console.log(WHAT_TO_DO_NEXT)
}


const WHAT_TO_DO_NEXT = `
-----------------------------------------------------------------
    What you do next:

    1. check your circle.yml

        $EDITOR circle.yml

    2. commit the changes

        git add -A
        git commit -m "add circle.yml"

    3. version bumping

        $(npm bin)/nca bmp p # patch level version up
        $(npm bin)/nca bmp m # minor level version up
        $(npm bin)/nca bmp j # major level version up

-----------------------------------------------------------------
`



if (require.main === module) run()
{'fraction_non_alphanumeric': 0.171875, 'fraction_numerical': 0.002170138888888889, 'mean_word_length': 2.4557721139430284, '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': '203222', 'n_tokens_mistral': 748, 'n_tokens_neox': 696, 'n_words': 187}