<commit_before>var static = require('node-static');
var path = require('path');
var fs = require('fs');
var Promise = require('bluebird');
var execAsync = Promise.promisify(require('child_process').exec);
var open = require('open');
var port = 8080;


function start () {
    var type = process.argv[3] || 'build',
        rootDir = path.normalize([__dirname, '..', type, 'client'].join('/')),
        title = 'kbup-' + String(port);
    process.title = title;
    if (!fs.existsSync(rootDir)) {
        console.log('root dir ' + rootDir + ' does not exist or is not accessible to you');
        return;
    }<commit_msg>recognizes "deployed" option to use the deploy dir, which it gets from the config.<commit_after>var static = require('node-static');
var path = require('path');
var fs = require('fs');
var Promise = require('bluebird');
var execAsync = Promise.promisify(require('child_process').exec);
var open = require('open');
var port = 8080;


function start () {
    var type = process.argv[3] || 'build',
	rootDir, 
        title = 'kbup-' + String(port);
    
    console.log('Starting local kbase-ui server');
    console.log('Type: ' + type);
    console.log('Port: ' + port);

    if (type === 'deployed') {
	// TODO: get this from the deploy config
	rootDir = '/kb/deployment/ui-common/';
    } else {
        rootDir = path.normalize([__dirname, '..', type, 'client'].join('/'));
    }
    process.title = title;
    if (!fs.existsSync(rootDir)) {
        console.log('root dir ' + rootDir + ' does not exist or is not accessible to you');
        return;
    }
{'fraction_non_alphanumeric': 0.17162761241291957, 'fraction_numerical': 0.006333122229259025, 'mean_word_length': 3.352617079889807, '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': '6232888', 'n_tokens_mistral': 496, 'n_tokens_neox': 481, 'n_words': 137}