mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
* feat(CommandsEnum.ts): add COMMANDS enum
* refactor(api.ts): use CONFIG_MODES enum from config.ts * refactor(config.ts): use COMMANDS and CONFIG_MODES enums, extract validateConfig function * feat(config.ts): add CONFIG_MODES enum and refactor configCommand function to use it * refactor(githook.ts): import COMMANDS enum from CommandsEnum.js file
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
OpenAIApi
|
||||
} from 'openai';
|
||||
|
||||
import { getConfig } from './commands/config';
|
||||
import { CONFIG_MODES, getConfig } from './commands/config';
|
||||
|
||||
const config = getConfig();
|
||||
|
||||
@@ -13,7 +13,7 @@ let apiKey = config?.OPENAI_API_KEY;
|
||||
|
||||
const [command, mode] = process.argv.slice(2);
|
||||
|
||||
if (!apiKey && command !== 'config' && mode !== 'set') {
|
||||
if (!apiKey && command !== 'config' && mode !== CONFIG_MODES.set) {
|
||||
intro('opencommit');
|
||||
|
||||
outro(
|
||||
|
||||
Reference in New Issue
Block a user