<commit_before>var fs = require('fs'),
    ncp = require('ncp').ncp,
    path = require('path'),
    argv = require('optimist')
      .usage('Usage: ionic appname')
      .argv;

Ionic = function() {
};

Ionic.prototype = {
  _checkArgs: function() {
    if(argv._.length == 0) {
      return false;
    }
    return true;
  },

  _printUsage: function() {
    process.stderr.write('Usage: ionic appname');
    process.exit(1);
  },

  _fail: function(msg) {
    process.stderr.write(msg + '\n');
    process.exit(1);
  },

  _writeTemplateFolder: function() {
    console.log('Copying template to', this.targetPath);
    ncp('template', this.appName, function(err) {
      if(err) {
        this._fail('Unable to build starter folder', err);
      }
    });
  },

  // Prompt the user for a response
  _ask: function(question) {
    var response;

    process.stdout.write(question + ' ');
    process.stdin.resume();
    response = fs.readSync(process.stdin.fd, 100, 0, "utf8");
    process.stdin.pause();
    return response[0].trim();
  },

  _checkTargetPath: function() { 
    if(fs.existsSync(this.targetPath)) {
      var resp = this._ask('The ' + this.targetPath + ' directory already exists. Overwrite files? (y/n)')
      if(resp === 'y') {
        return true;
      }
      return false;
    }
    return true;
  },

  run: function() {
    if(this._checkArgs() === false) {
      return this._printUsage();
    }

    this.appName = argv._[0];
    this.targetPath = path.resolve(this.appName);

    // Make sure to create this, or ask them if they want to override it
    if(this._checkTargetPath() === false) {
      process.stderr.write('Not continuing.');
      process.exit(1);
    }

    console.log('Creating Ionic app in folder', this.targetPath);

    this._writeTemplateFolder();
  }
};


var ionic = new Ionic();
ionic.run();<commit_msg>Having fun with ASCII Art<commit_after>/*
   __          __  
| /  \ |\ | | /  ` 
| \__/ | \| | \__, 

Licensed under the Apache 2.0 license. See LICENSE For mroe.

Copyright 2013 Drifty (http://drifty.com/)
*/
                   
var fs = require('fs'),
    ncp = require('ncp').ncp,
    path = require('path'),
    argv = require('optimist')
      .usage('Usage: ionic appname')
      .argv;

Ionic = function() {
};

Ionic.prototype = {
  _checkArgs: function() {
    if(argv._.length == 0) {
      return false;
    }
    return true;
  },

  _printUsage: function() {
    this._printIonic();
    process.stderr.write('Usage: ionic appname\n');
    process.exit(1);
  },

  _printIonic: function() {
    process.stdout.write('\n   __          __  \n');
    process.stdout.write('| /  \\ |\\ | | /  `\n' + '| \\__/ | \\| | \\__,\n\n');
  },

  _fail: function(msg) {
    process.stderr.write(msg + '\n');
    process.exit(1);
  },

  _writeTemplateFolder: function() {
    console.log('Copying template to', this.targetPath);
    ncp('template', this.appName, function(err) {
      if(err) {
        this._fail('Unable to build starter folder', err);
      }
    });
  },

  // Prompt the user for a response
  _ask: function(question) {
    var response;

    process.stdout.write(question + ' ');
    process.stdin.resume();
    response = fs.readSync(process.stdin.fd, 100, 0, "utf8");
    process.stdin.pause();
    return response[0].trim();
  },

  _checkTargetPath: function() { 
    if(fs.existsSync(this.targetPath)) {
      var resp = this._ask('The ' + this.targetPath + ' directory already exists. Overwrite files? (y/n)')
      if(resp === 'y') {
        return true;
      }
      return false;
    }
    return true;
  },

  run: function() {
    if(this._checkArgs() === false) {
      return this._printUsage();
    }

    this._printIonic();

    this.appName = argv._[0];
    this.targetPath = path.resolve(this.appName);

    // Make sure to create this, or ask them if they want to override it
    if(this._checkTargetPath() === false) {
      process.stderr.write('Not continuing.');
      process.exit(1);
    }

    console.log('Creating Ionic app in folder', this.targetPath);

    this._writeTemplateFolder();
  }
};


var ionic = new Ionic();
ionic.run();
{'fraction_non_alphanumeric': 0.16690786300048238, 'fraction_numerical': 0.006753497346840328, 'mean_word_length': 2.5144067796610168, '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': '5681305', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1360, 'n_words': 293}