Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
- Config backwards compatible
- Readable config parse error message
  • Loading branch information
catplvsplus committed Jul 25, 2022
1 parent 016df9b commit a953a11
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reciple",
"version": "3.1.1",
"version": "3.1.2",
"bin": "bin/bin.js",
"license": "GPL-3.0",
"main": "bin/index.js",
Expand Down
2 changes: 1 addition & 1 deletion resource/reciple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ ignoredFiles: []
modulesFolder: 'modules'

# Current version
version: VERSION
version: ^VERSION
12 changes: 11 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { RecipleConfig } from './reciple/classes/RecipleConfig';
import { flags } from './reciple/flags';
import { version } from './reciple/version';

import chalk from 'chalk';
import { input } from 'fallout-utility';
import { existsSync, readdirSync } from 'fs';

Expand All @@ -21,7 +22,16 @@ if (readdirSync('./').filter(f => !f.startsWith('.') && allowedFiles.indexOf(f))
if (ask.toString().toLowerCase() !== 'y') process.exit(0);
}

const config = new RecipleConfig(flags.config ?? './reciple.yml').parseConfig().getConfig();
let configParser: RecipleConfig;

try {
configParser = new RecipleConfig(flags.config ?? './reciple.yml').parseConfig();
} catch (err) {
console.error(`${chalk.bold.red('Config Error')}: ${chalk.white((err as Error).message)}`);
process.exit(1);
}

const config = configParser.getConfig();
const client = new RecipleClient({ config: config, ...config.client });

if (config.fileLogging.clientLogs) client.logger.info('Reciple Client v' + version + ' is starting...');
Expand Down

0 comments on commit a953a11

Please sign in to comment.