mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 00:43:49 +01:00
[BREAKING CHANGE] テスト時の設定ファイルを分けるように
See CHANGELOG for more details
This commit is contained in:
parent
cb7cb04caa
commit
5834120107
@ -1,4 +1,7 @@
|
||||
# Server
|
||||
## 2
|
||||
configのファイル名: config.yml --> default.yml
|
||||
|
||||
## 1
|
||||
First version
|
||||
|
||||
|
@ -31,12 +31,12 @@ const env = process.env.NODE_ENV;
|
||||
const isProduction = env === 'production';
|
||||
const isDebug = !isProduction;
|
||||
|
||||
if (!fs.existsSync('./.config/config.yml')) {
|
||||
if (!fs.existsSync('./.config/default.yml')) {
|
||||
console.log('npm run configを実行して設定ファイルを作成してください');
|
||||
process.exit();
|
||||
}
|
||||
|
||||
(global as any).MISSKEY_CONFIG_PATH = '.config/config.yml';
|
||||
(global as any).MISSKEY_CONFIG_PATH = '.config/default.yml';
|
||||
import { IConfig } from './src/config';
|
||||
const config = eval(require('typescript').transpile(require('fs').readFileSync('./src/config.ts').toString()))() as IConfig;
|
||||
|
||||
|
@ -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`;
|
||||
|
||||
/**
|
||||
* ユーザーが設定する必要のある情報
|
||||
|
@ -3,7 +3,7 @@ const yaml = require('js-yaml');
|
||||
const inquirer = require('inquirer');
|
||||
|
||||
const configDirPath = `${__dirname}/../.config`;
|
||||
const configPath = `${configDirPath}/config.yml`;
|
||||
const configPath = `${configDirPath}/default.yml`;
|
||||
|
||||
const form = [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user