mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-06-20 20:21:45 +00:00
23 lines
522 B
TypeScript
23 lines
522 B
TypeScript
import path from "node:path";
|
|
|
|
function setPath(): string {
|
|
return process.env.ZIGBEE2MQTT_DATA ? process.env.ZIGBEE2MQTT_DATA : path.normalize(path.join(__dirname, "..", "..", "data"));
|
|
}
|
|
|
|
let dataPath = setPath();
|
|
|
|
function joinPath(file: string): string {
|
|
return path.resolve(dataPath, file);
|
|
}
|
|
|
|
function getPath(): string {
|
|
return dataPath;
|
|
}
|
|
|
|
function _testReload(): void {
|
|
dataPath = setPath();
|
|
}
|
|
|
|
// biome-ignore lint/style/useNamingConvention: test
|
|
export default {joinPath, getPath, _testReload};
|