This commit is contained in:
syuilo
2017-01-17 08:19:34 +09:00
parent b6ef2fcb04
commit 33b6c232c9
5 changed files with 16 additions and 12 deletions

View File

@@ -6,6 +6,8 @@ import * as fs from 'fs';
import * as yaml from 'js-yaml';
import * as isUrl from 'is-url';
export const path = (global as any).MISSKEY_CONFIG_PATH ? (global as any).MISSKEY_CONFIG_PATH : `${__dirname}/../.config/config.yml`;
/**
* ユーザーが設定する必要のある情報
*/
@@ -62,10 +64,7 @@ interface Mixin {
export type IConfig = ISource & Mixin;
export default load();
function load() {
const path = (global as any).MISSKEY_CONFIG_PATH ? (global as any).MISSKEY_CONFIG_PATH : `${__dirname}/../.config/config.yml`;
export default function load() {
const config = yaml.safeLoad(fs.readFileSync(path, 'utf8')) as ISource;
const mixin: Mixin = {} as Mixin;