<commit_before>var aira = require('../index');
var Web3 = require('web3');
var path = require('path');
var web3 = new Web3();

var version = require('../package.json').version;
require('child_process').exec('git rev-parse HEAD', function (err, result) {
    if (!result.toString().match('fatal'))
        version += ' (' + result.toString().slice(0, 8) + ')';
});

const mainsol  = __dirname + '/../sol';
const cachedir = __dirname + '/../.cache';
const libsfile = __dirname + '/../.libs.json';

var argv = require('optimist')
    .usage('AIRA Deploy :: version '+version+'\n\nUsage: $0 -I [DIRS] -C [NAME] -A [ARGUMENTS] [-O] [--rpc URI] [--library] [--creator] [--abi] [--bytecode]')
    .default({I: '', A: '[]', rpc: 'http://localhost:8545'})
    .boolean(['library', 'creator', 'abi', 'O'])
    .describe('I', 'Append source file dirs')
    .describe('C', 'Contract name')
    .describe('A', 'Contract constructor arguments [JSON]')
    .describe('O', 'Enable compiler optimization')
    .describe('rpc', 'Web3 RPC provider')
    .describe('library', 'Store deployed library address after deploy')
    .describe('creator', 'Generate contract creator library and exit')
    .describe('bytecode', 'Print compiled and linked bytecode')
    .describe('abi', 'Print contract ABI and exit')
    .demand(['C'])
    .argv;

console.log(argv.I);
var soldirs = argv.I == '' ? [] : argv.I;
soldirs.push(mainsol); 
var args = JSON.parse(argv.A); 
var contract = argv.C;
web3.setProvider(new web3.providers.HttpProvider(argv.rpc));

aira.compiler.compile(soldirs, cachedir, argv.O, function (compiled) {
    console.log('\nContract:\t' + contract);

    if (typeof(compiled.errors) != 'undefined') {
        console.log('An error occured:');
        // Print errors<commit_msg>Include contract dirs bug fix<commit_after>var aira = require('../index');
var Web3 = require('web3');
var path = require('path');
var web3 = new Web3();

var version = require('../package.json').version;
require('child_process').exec('git rev-parse HEAD', function (err, result) {
    if (!result.toString().match('fatal'))
        version += ' (' + result.toString().slice(0, 8) + ')';
});

const mainsol  = __dirname + '/../sol';
const cachedir = __dirname + '/../.cache';
const libsfile = __dirname + '/../.libs.json';

var argv = require('optimist')
    .usage('AIRA Deploy :: version '+version+'\n\nUsage: $0 -I [DIRS] -C [NAME] -A [ARGUMENTS] [-O] [--rpc URI] [--library] [--creator] [--abi] [--bytecode]')
    .default({I: '', A: '[]', rpc: 'http://localhost:8545'})
    .boolean(['library', 'creator', 'abi', 'O'])
    .describe('I', 'Append source file dirs')
    .describe('C', 'Contract name')
    .describe('A', 'Contract constructor arguments [JSON]')
    .describe('O', 'Enable compiler optimization')
    .describe('rpc', 'Web3 RPC provider')
    .describe('library', 'Store deployed library address after deploy')
    .describe('creator', 'Generate contract creator library and exit')
    .describe('bytecode', 'Print compiled and linked bytecode')
    .describe('abi', 'Print contract ABI and exit')
    .demand(['C'])
    .argv;

console.log(argv.I);
var soldirs = argv.I == '' ? [] : (typeof(argv.I) == 'string' ? [argv.I] : argv.I);
soldirs.push(mainsol); 
var args = JSON.parse(argv.A); 
var contract = argv.C;
web3.setProvider(new web3.providers.HttpProvider(argv.rpc));

aira.compiler.compile(soldirs, cachedir, argv.O, function (compiled) {
    console.log('\nContract:\t' + contract);

    if (typeof(compiled.errors) != 'undefined') {
        console.log('An error occured:');
        // Print errors
{'fraction_non_alphanumeric': 0.20745272525027808, 'fraction_numerical': 0.00778642936596218, 'mean_word_length': 3.8411843876177656, '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': '2845701', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1157, 'n_words': 298}