2018-01-11 18:57:11 +08:00
|
|
|
'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));
|
2018-01-11 18:57:11 +08:00
|
|
|
|
|
|
|
if (directory && directory.length > 0) {
|
|
|
|
process.env.ICU_DATA = directory[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = setICUEnvVariable;
|