Files
homebridge/lib/user.js
Nick Farina bf5fc50fa6 Remove non-standard "type annotations"
Since we're not actually using Flow.
2015-07-17 08:57:56 -07:00

32 lines
634 B
JavaScript

import path from 'path';
import fs from 'fs';
import { Config } from './config';
//
// Manages user settings and storage locations.
//
// global cached config
let config;
export class User {
static get config() {
return config || (config = Config.load(User.configPath));
}
static get storagePath() {
let home = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
return path.join(home, ".homebridge");
}
static get configPath() {
return path.join(User.storagePath, "config.json");
}
static get providersPath() {
return path.join(User.storagePath, "providers");
}
}