diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-17 08:37:24 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-17 08:37:24 +0900 |
| commit | 9abb108b5e6632302aa6844cb8d28c4a090ab1cc (patch) | |
| tree | 7e685abc1637595779fd8c80cf82b4b2bd22cc55 /src | |
| parent | [WIP] test (diff) | |
| download | sharkey-9abb108b5e6632302aa6844cb8d28c4a090ab1cc.tar.gz sharkey-9abb108b5e6632302aa6844cb8d28c4a090ab1cc.tar.bz2 sharkey-9abb108b5e6632302aa6844cb8d28c4a090ab1cc.zip | |
[BREAKING CHANGE] テスト時の設定ファイルを分けるように
See CHANGELOG for more details
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/config.ts b/src/config.ts index 342e2db78b..d26ce5656d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -6,7 +6,19 @@ 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`; +/** + * Path of configuration directory + */ +const dir = `${__dirname}/../.config`; + +/** + * Path of configuration file + */ +export const path = (global as any).MISSKEY_CONFIG_PATH + ? (global as any).MISSKEY_CONFIG_PATH + : process.env.NODE_ENV == 'test' + ? `${dir}/test.yml` + : `${dir}/default.yml`; /** * ユーザーが設定する必要のある情報 |