pull-watch

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: MIT

README ยถ

             _ _                      _       _
            | | |                    | |     | |
 _ __  _   _| | |________      ____ _| |_ ___| |__
| '_ \| | | | | |______\ \ /\ / / _` | __/ __| '_ \
| |_) | |_| | | |       \ V  V / (_| | || (__| | | |
| .__/ \__,_|_|_|        \_/\_/ \__,_|\__\___|_| |_|
| |
|_|

pull-watch -- ./do_something_when_your_git_repo_changes.sh

A hobbyist-grade tool that watches a git repository for changes and runs a specified command when changes are detected.

Your friendly neighborhood Git repository watchdog! ๐Ÿ• Guards your watch, your time, avoids wasting it, get it? No? Never mind. I am just a dad. It's muscle memory at this point!

Never miss a change again - pull-watch sits patiently by your repository, waiting to spring into action whenever something new comes along. Perfect for developers who want their local environment to stay in sync without the hassle of manual updates.

โœจ Features

  • ๐Ÿ•’ Configurable poll interval (because sometimes you need a coffee break)
  • ๐ŸŽฏ Graceful process management (no rough handling here!)
  • ๐Ÿ“ Support for different git directories (home is where your .git is)
  • ๐Ÿ“ข Verbose logging option (for when you're feeling chatty)
  • ๐Ÿ›ก๏ธ Proper signal handling (catches signals like a pro)
  • โฑ๏ธ Context-aware git operations with timeouts (patience is a virtue, but timeouts are better)

๐Ÿš€ Installation

Quick and easy - just like ordering pizza!

Go Install
go install github.com/ship-digital/pull-watch@latest
Homebrew
brew tap ship-digital/tap
brew install pull-watch
Chocolatey (Windows)
choco install pull-watch

๐ŸŽฎ Usage

pull-watch [options] -- <command>

Options:
  -interval duration
        Poll interval (e.g. 15s, 1m) (default 15s)
  -git-dir string
        Git repository directory (default ".")
  -verbose
        Enable verbose logging
  -graceful
        Try graceful stop before force kill
  -stop-timeout duration
        Timeout for graceful stop before force kill (default 5s)

๐ŸŒŸ Examples

Watch current directory and restart a server when changes are detected:

Keep your server fresh and up-to-date!

pull-watch -- go run main.go
Watch specific directory with custom interval:

For when you want to keep an eye on things from a distance...

pull-watch -git-dir /path/to/repo -interval 1m -- npm start
Force kill processes (default):

The "no time for chitchat" approach

pull-watch -- node server.js
Graceful stop before force kill:

For the gentler souls among us

pull-watch -graceful -stop-timeout 10s -- ./my-server

Made with โค๏ธ by @deblasis for developers who appreciate a touch of automation in their lives.

Directories ยถ

Path Synopsis
cmd
pull-watch command
internal
git

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL