378: fix hook env (#402)
* fix(prepare-commit-msg-hook): update error handling to provide clearer instructions for setting API keys and improve user guidance * build
This commit is contained in:
+4848
-7910
File diff suppressed because one or more lines are too long
+2170
-20
File diff suppressed because it is too large
Load Diff
@@ -44,9 +44,10 @@ export const prepareCommitMessageHook = async (
|
|||||||
!config.OCO_ANTHROPIC_API_KEY &&
|
!config.OCO_ANTHROPIC_API_KEY &&
|
||||||
!config.OCO_AZURE_API_KEY
|
!config.OCO_AZURE_API_KEY
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
outro(
|
||||||
'No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit'
|
'No OCO_OPENAI_API_KEY or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key via `oco config set <key>=<value>, e.g. `oco config set OCO_OPENAI_API_KEY=<value>`. For more info see https://github.com/di-sukharev/opencommit'
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const spin = spinner();
|
const spin = spinner();
|
||||||
|
|||||||
Reference in New Issue
Block a user