mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
feat(README.md): add GitHub Hackathon winner badge to project description
docs(README.md): restructure README, move CLI setup instructions to top for better visibility feat(cli.cjs): extend file exclusion list in 'getDiff' to include image files for better performance refactor(config.ts): add more model options in configValidators for flexibility refactor(config.ts): set default model to 'gpt-3.5-turbo-16k' for better performance refactor(git.ts): simplify 'getCoreHooksPath' function for readability feat(git.ts): extend file exclusion list in 'getDiff' to include image files for better performance
This commit is contained in:
@@ -25,13 +25,11 @@ export const getOpenCommitIgnore = (): Ignore => {
|
||||
return ig;
|
||||
};
|
||||
|
||||
export const getCoreHooksPath = async(): Promise<string> => {
|
||||
const { stdout } = await execa('git', [
|
||||
'config',
|
||||
'core.hooksPath']);
|
||||
export const getCoreHooksPath = async (): Promise<string> => {
|
||||
const { stdout } = await execa('git', ['config', 'core.hooksPath']);
|
||||
|
||||
return stdout;
|
||||
}
|
||||
};
|
||||
|
||||
export const getStagedFiles = async (): Promise<string[]> => {
|
||||
const { stdout: gitDir } = await execa('git', [
|
||||
@@ -83,12 +81,20 @@ export const gitAdd = async ({ files }: { files: string[] }) => {
|
||||
|
||||
export const getDiff = async ({ files }: { files: string[] }) => {
|
||||
const lockFiles = files.filter(
|
||||
(file) => file.includes('.lock') || file.includes('-lock.')
|
||||
(file) =>
|
||||
file.includes('.lock') ||
|
||||
file.includes('-lock.') ||
|
||||
file.includes('.svg') ||
|
||||
file.includes('.png') ||
|
||||
file.includes('.jpg') ||
|
||||
file.includes('.jpeg') ||
|
||||
file.includes('.webp') ||
|
||||
file.includes('.gif')
|
||||
);
|
||||
|
||||
if (lockFiles.length) {
|
||||
outro(
|
||||
`Some files are '.lock' files which are excluded by default from 'git diff'. No commit messages are generated for this files:\n${lockFiles.join(
|
||||
`Some files are excluded by default from 'git diff'. No commit messages are generated for this files:\n${lockFiles.join(
|
||||
'\n'
|
||||
)}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user