<commit_before>//*/
const ReadYaml = require('read-yaml');
const WriteYaml = require('write-yaml');
const PgPromise = require('pg-promise');
/*/
import ReadYaml from 'read-yaml';
import WriteYaml from 'write-yaml';
import PgPromise from 'pg-promise';
//*/
//constants
const yml = {read: ReadYaml, write: WriteYaml};

// Configuations
var cfg = yml.read.sync('./conf/config.yml');
const pgp = PgPromise({capSQL:true});
const db = pgp(cfg.database);
var sql = yml.read.sync('./sql.yml');
var flags = yml.read.sync('./flags.yml');
var globalflags = yml.read.sync('./flags.global.yml');
var errors = yml.read.sync('./errors.yml');
var cwd = process.cwd();


const env = cfg.devmode? 'development' : process.env.NODE_ENV||'production';

// import Monitor from 'pg-monitor';
// Monitor.attach(pgpopts);

var cdn;
if (!cfg.options.use_external_cdn || cfg.values.cdn_domain == 'localhost') cdn = '';
else if (!cfg.values.cdn_domain.contains('://'))
	cdn = cfg.values.cdn_domain?'//'+cfg.values.cdn_domain:'';

const configs = {
    yml,cfg,sql,pgp,db,flags,globalflags,errors,cdn,env,cwd,
    reload: ()=>{
		this.cfg = yml.read.sync('./conf/config.yml');
		this.sql = yml.read.sync('./sql.yml');
		this.flags = yml.read.sync('./flags.yml');
		this.globalflags = yml.read.sync('./flags.global.yml');
		this.errors = yml.read.sync('./errors.yml');
    }
};

module.exports = configs;
// export {configs as Config};
// export {configs as default};
<commit_msg>Fixed app install calling config for a non-existant file. Falls back on the default config file during install.<commit_after>//*/
const ReadYaml = require('read-yaml');
const WriteYaml = require('write-yaml');
const PgPromise = require('pg-promise');
/*/
import ReadYaml from 'read-yaml';
import WriteYaml from 'write-yaml';
import PgPromise from 'pg-promise';
//*/
//constants
const yml = {read: ReadYaml, write: WriteYaml};

// Configuations
var cfg;
try {
	cfg = yml.read.sync('./conf/config.yml');
} catch (e){
	cfg = yml.read.sync('./install/default.yml');
}
const pgp = PgPromise({capSQL:true});
const db = pgp(cfg.database);
var sql = yml.read.sync('./sql.yml');
var flags = yml.read.sync('./flags.yml');
var globalflags = yml.read.sync('./flags.global.yml');
var errors = yml.read.sync('./errors.yml');
var cwd = process.cwd();


const env = cfg.devmode? 'development' : process.env.NODE_ENV||'production';

// import Monitor from 'pg-monitor';
// Monitor.attach(pgpopts);

var cdn;
if (!cfg.options.use_external_cdn || cfg.values.cdn_domain == 'localhost') cdn = '';
else if (!cfg.values.cdn_domain.contains('://'))
	cdn = cfg.values.cdn_domain?'//'+cfg.values.cdn_domain:'';

const configs = {
    yml,cfg,sql,pgp,db,flags,globalflags,errors,cdn,env,cwd,
    reload: ()=>{
		this.cfg = yml.read.sync('./conf/config.yml');
		this.sql = yml.read.sync('./sql.yml');
		this.flags = yml.read.sync('./flags.yml');
		this.globalflags = yml.read.sync('./flags.global.yml');
		this.errors = yml.read.sync('./errors.yml');
    }
};

module.exports = configs;
// export {configs as Config};
// export {configs as default};

{'fraction_non_alphanumeric': 0.20247395833333334, 'fraction_numerical': 0.0, 'mean_word_length': 4.217317487266554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '586912', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1077, 'n_words': 223}