Windshaft-cartodb/lib/cartodb/utils/icu_data_env_setter.js

20 lines
599 B
JavaScript
Raw Normal View History

'use strict';
const glob = require('glob');
const path = require('path');
// See https://github.com/CartoDB/support/issues/984
// CartoCSS properties text-wrap-width/text-wrap-character not working
function setICUEnvVariable() {
if (process.env.ICU_DATA === undefined) {
2018-01-11 19:22:51 +08:00
const regexedPath = '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/';
const directory = glob.sync(path.join(__dirname, '../../..', regexedPath));
if (directory && directory.length > 0) {
process.env.ICU_DATA = directory[0];
}
}
}
module.exports = setICUEnvVariable;