Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: add checkGitRepository function #7

Merged
merged 1 commit into from
Mar 6, 2023
Merged

✨ feat: add checkGitRepository function #7

merged 1 commit into from
Mar 6, 2023

Conversation

insulineru
Copy link
Owner

This commit adds the checkGitRepository function to the helpers.js module which checks if the current directory is a Git repository using the git rev-parse --is-inside-work-tree command. If it's not a Git repository, an error message will be logged to the console and the process will exit with code 1. The checkGitRepository function is exported from the module along with the getArgs function.

Additionally, this commit modifies the index.js module to import checkGitRepository from helpers.js. The generateAICommit function now calls checkGitRepository before executing the git diff --staged command and logs an error message if it returns false.

This commit adds the `checkGitRepository` function to the `helpers.js` module which checks if the current directory is a Git repository using the `git rev-parse --is-inside-work-tree` command. If it's not a Git repository, an error message will be logged to the console and the process will exit with code 1. The `checkGitRepository` function is exported from the module along with the `getArgs` function.

Additionally, this commit modifies the `index.js` module to import `checkGitRepository` from `helpers.js`. The `generateAICommit` function now calls `checkGitRepository` before executing the `git diff --staged` command and logs an error message if it returns false.
@insulineru insulineru merged commit 452357b into main Mar 6, 2023
@insulineru insulineru deleted the check-git branch March 6, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant