mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
@@ -14,6 +14,9 @@ module.exports = {
|
||||
// global cached config
|
||||
var config;
|
||||
|
||||
// optional custom storage path
|
||||
var customStoragePath;
|
||||
|
||||
function User() {
|
||||
}
|
||||
|
||||
@@ -22,6 +25,7 @@ User.config = function() {
|
||||
}
|
||||
|
||||
User.storagePath = function() {
|
||||
if (customStoragePath) return customStoragePath;
|
||||
var home = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
return path.join(home, ".homebridge");
|
||||
}
|
||||
@@ -33,3 +37,7 @@ User.configPath = function() {
|
||||
User.persistPath = function() {
|
||||
return path.join(User.storagePath(), "persist");
|
||||
}
|
||||
|
||||
User.setStoragePath = function(path) {
|
||||
customStoragePath = path;
|
||||
}
|
||||
Reference in New Issue
Block a user