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

const program = require('commander');
const TOKEN = require('./token');
const inquirer = require("inquirer");
const axios = require('axios');
const chalk = require('chalk');

var headers = {
  'Authorization': `token ${TOKEN}`
};

var parameter = [
  {
    type: 'input',
    name: 'name',
    message: 'Repository name: '
  },
  {
    type: 'input',
    name: 'description',
    message: 'Description: '
  },
  {
    type: 'list',
    name: 'auto_init',
    message: 'Initialize Readme?',
    choices: [
      "Yes",
      "No",
    ]
  },
  {
    type: 'list',
    name: 'private',
    message: 'Make Repository Private?',
    choices: [
      "Yes",
      "No",
    ]
  },
]

program
  .option('-r, --name <Repository>', 'Enter Repository name')
  .option('-d, --description  <Description >', 'Enter Description')
  .option('-i, --auto_init', 'Add this flag to initialize Readme')
  .option('-p, --private', 'Add this flag to make repository private')
  .action(function(init) {
    inquirer.prompt(parameter, function(response) {
      var data = {
        name: response.name,
        description: response.description,
        gitignore_template: "nanoc"
      };

      if(response.auto_init === 'Yes') {
        data.auto_init = true;
      } else {
        data.auto_init = false;
      }

      if(response.private === 'Yes') {
        data.private = true;
      } else {
        data.private = false;
      }

      axios({
        method:'post',
        url:'/user/repos',
        baseURL: 'https://api.github.com',
        headers: headers,
        data: data
      }).then(function(response) {
        var errorMessage;
        if(!response.message) {
          var link = response.ssh_url;
          console.log(chalk.bold.cyan('Repo Created, SSH URL is: ') + link);
          process.exit(0);
        } else if(response.message) {
          errorMessage = "Authentication failed!";
        } else {
          errorMessage = response.message;
        }
        console.log(chalk.red(errorMessage));
        process.exit(1);
      });
    });
  })
  .parse(process.argv);<commit_msg>fixed the error<commit_after>#!/usr/bin/env node

const TOKEN = require('./token');
const inquirer = require('inquirer');
const axios = require('axios');
const chalk = require('chalk');

var headers = {
  'Authorization': `token ${TOKEN}`
};

var parameter = [
  {
    type: 'input',
    name: 'name',
    message: 'Repository name: '
  },
  {
    type: 'input',
    name: 'description',
    message: 'Description: '
  },
  {
    type: 'list',
    name: 'auto_init',
    message: 'Initialize Readme?',
    choices: [
      "Yes",
      "No",
    ]
  },
  {
    type: 'list',
    name: 'private',
    message: 'Make Repository Private?',
    choices: [
      "Yes",
      "No",
    ]
  },
]

inquirer.prompt(parameter).then(function (answers) {
  var data = {
    name: answers.name,
    description: answers.description,
    gitignore_template: "nanoc"
  };

  if(answers.auto_init === 'Yes') {
    data.auto_init = true;
  } else {
    data.auto_init = false;
  }

  if(answers.private === 'Yes') {
    data.private = true;
  } else {
    data.private = false;
  }

  axios({
    method:'post',
    url:'/user/repos',
    baseURL: 'https://api.github.com',
    headers: headers,
    data: data
  }).then(function(response) {
    var link = response.ssh_url;
    console.log(chalk.bold.cyan('Repo Created, SSH URL is: ') + link);
  })
  .catch(function (error) {
    var errorMessage;
    if(error.message) {
      errorMessage = "Authentication failed!";
    } else {
      errorMessage = error.message;
    }
    console.log(chalk.red(errorMessage));
    process.exit(1);
  });
});
{'fraction_non_alphanumeric': 0.16603875134553284, 'fraction_numerical': 0.0008073196986006459, 'mean_word_length': 2.4038461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1900103', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1223, 'n_words': 258}