From b9be92c524fc4b5cd26627113491e245c1f514cd Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 16 Sep 2026 14:54:05 +0200 Subject: [PATCH] feat: --gitpush --- README.md | 1 + pyproject.toml | 2 +- src/watchyap/watchyap.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df03036..0e255ba 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Actions: * `--save`: Save a snapshot of the watched file. * `--inkscape`: Save a PNG snpashot of the watched SVG file. * `--git`: Commit the watched file if it has been modified. +* `--gitpush`: Commit, pull and push the watched file if it has been modified. * `--log`: Print a message. * `--dbus`: Send a notification to the system's D-Bus. * `--zenity`: Pop-up a dialog window. diff --git a/pyproject.toml b/pyproject.toml index 184f937..a867e50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "watchyap" -version = "0.2.0" +version = "0.3.0" description = "Automagically perform an action each time you touch watched files" readme = "README.md" authors = [ diff --git a/src/watchyap/watchyap.py b/src/watchyap/watchyap.py index 783f021..0fe5787 100755 --- a/src/watchyap/watchyap.py +++ b/src/watchyap/watchyap.py @@ -100,6 +100,7 @@ Examples: if shutil.which("git"): HAS_GIT = True existing["git"] = ["Commit the target files if it has been modified [the repository should be set-up].", None] + existing["gitpush"] = ["Commit, pull and push the target files if it has been modified [the repository should be set-up].", None] else: HAS_GIT = False @@ -136,8 +137,9 @@ Examples: if HAS_GIT: logging.debug("`git` command found") available["git"][1] = Command("git add {target} ; git commit -m 'Automatic watchyap commit of {target} at {timestamp}'") + available["gitpush"][1] = Command("git add {target} ; git commit -m 'Automatic watchyap commit of {target} at {timestamp}' ; git pull ; git push") else: - print("WARNING: `git` command not found, the --inkscape action is disabled.", file=sys.stderr) + print("WARNING: `git` command not found, the --git* actions are disabled.", file=sys.stderr) if HAS_INKSCAPE: logging.debug("`inkscape` command found")