zigbee2mqtt/lib/util/data.js
2018-05-17 17:20:46 +02:00

15 lines
317 B
JavaScript

const path = require('path');
let dataPath = null;
if (process.env.ZIGBEE2MQTT_DATA) {
dataPath = process.env.ZIGBEE2MQTT_DATA;
} else {
dataPath = path.join(__dirname, '..', '..', 'data');
dataPath = path.normalize(dataPath);
}
module.exports = {
joinPath: (file) => path.join(dataPath, file),
};