<commit_before>var fs = require('fs');
function getUserHome() {
    return process.env.HOME || process.env.USERPROFILE;
}
var duniterConf = JSON.parse(fs.readFileSync(getUserHome()+'/.config/duniter/duniter_default/conf.json', 'utf8'));
var host = duniterConf.remotehost;
if(!host) host = duniterConf.remoteipv4;
if(!host) host = duniterConf.remoteipv6;
var cesiumConf = {
    "default": {
        "node":{
            "host":host,
            "port":duniterConf.remoteport
        }
    }
};
fs.writeFileSync('cesium/app/config.json',JSON.stringify(cesiumConf));<commit_msg>Fixing duniter/duniter#736 Not building on AppVeyor<commit_after>var fs = require('fs');
function getUserHome() {
    return process.env.HOME || process.env.USERPROFILE;
}

try {

    var duniterConf = JSON.parse(fs.readFileSync(getUserHome()+'/.config/duniter/duniter_default/conf.json', 'utf8'));
    var host = duniterConf.remotehost;
    if(!host) host = duniterConf.remoteipv4;
    if(!host) host = duniterConf.remoteipv6;
    var cesiumConf = {
        "default": {
            "node":{
                "host":host,
                "port":duniterConf.remoteport
            }
        }
    };
    fs.writeFileSync('cesium/app/config.json',JSON.stringify(cesiumConf));

} catch (e) {
    console.log('Not Duniter configuration found, skipping Cesium configuration.');
}
{'fraction_non_alphanumeric': 0.14825796886582654, 'fraction_numerical': 0.006671608598962194, 'mean_word_length': 3.3548387096774195, 'pattern_counts': {'":': 8, '<': 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': '4125593', 'n_tokens_mistral': 449, 'n_tokens_neox': 452, 'n_words': 70}