Skip to content

Commit

Permalink
Updated and modified files for the project
Browse files Browse the repository at this point in the history
- Updated files:
  - pyproject.toml
  - src/gitcommiter/gitcommiter.py
  • Loading branch information
Aviksaikat committed May 30, 2024
1 parent cbfa3b6 commit ebad36a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[project]
name = "gitcommiter"
version = "0.1.2"
version = "0.1.3"
description = "Automatically add and commit new, modified, and deleted files to Git and write super cool commit messages."
authors = [{ name = "SAIKAT KARMAKAR", email = "saikickkarma@protonmail.com" }]
authors = [{ name = "SAIKAT KARMAKAR", email = "github.maturity983@passinbox.com" }]
license = { file = "LICENSE" }
readme = "README.md"

Expand Down
9 changes: 7 additions & 2 deletions src/gitcommiter/gitcommiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def construct_commit_message(untracked_files, modified_files, deleted_files):
"-d", "--directory", type=click.Path(exists=True), help="Directory to process"
)
@click.option("-p", "--push", is_flag=True, help="Push changes to the remote repository")
@click.option("-nv", "--no-verify", is_flag=True, help="Ignore pre-commit hooks")
@click.option("-h", "--help", is_flag=True, help="Print help message")
def git_add_and_commit(directory, push, help):
def git_add_and_commit(directory, push, no_verify, help):
if help:
print_banner()
click.echo("Automatically add and commit new, modified, and deleted files to Git and write super cool commit messages")
Expand All @@ -58,6 +59,7 @@ def git_add_and_commit(directory, push, help):
click.echo("\nOptions:")
click.echo(" -d, --directory Directory to process")
click.echo(" -p, --push Push changes to the remote repository")
click.echo(" -nv, --no-verify Ignore pre-commit hooks")
click.echo(" -h, --help Print this message")
click.get_current_context().exit()

Expand Down Expand Up @@ -104,7 +106,10 @@ def git_add_and_commit(directory, push, help):

# Commit changes
if commit_message:
subprocess.run(["git", "commit", "-m", commit_message])
if no_verify:
subprocess.run(["git", "commit", "-m", commit_message, "--no-verify"])
else:
subprocess.run(["git", "commit", "-m", commit_message])

# Push changes if the -p/--push option is passed
if push:
Expand Down

0 comments on commit ebad36a

Please sign in to comment.