zigbee2mqtt/lib/util/data.js
2018-05-11 23:04:15 -04:00

15 lines
279 B
JavaScript

const path = require('path');
function dataPath() {
if (process.env.ZIGBEE2MQTT_DATA) {
return process.env.ZIGBEE2MQTT_DATA;
} else {
return `${__dirname}/../../data`;
}
}
module.exports = {
path: dataPath(),
joinPath: (file) => path.join(dataPath(), file)
}