GithubHelp home page GithubHelp logo

overlord's Introduction

Overlord - simple git hooks launcher

Overlord

This simple script, used as a git hook, executes all scripts in the corresponding hook-name.d directory.

It is also capable of daemonizing itself for a limited set of git hooks where the scripts execution will not affect the outcome of the action.

Install

Drop this script into your hooks directory. Another option is to clone this directory, and point your core.hooksPath config variable to it.

Example (replace the directories paths with your own):

export HOOKS_ROOT=path/to/your/hooks/root/dir
cd "$HOOKS_ROOT"
# either direct download
#mkdir -p overlord && wget https://raw.githubusercontent.com/amartos/overlord/master/overlord -O overlord/overlord
# or clone the repo
git clone https://github.com/amartos/overlord
cd path/to/your/git/repo
git config core.hooksPath "$HOOKS_ROOT"/overlord

Then, symlink the overlord script as a git hook, and create the corresponding hook-name.d directory alongside the overlord script.

cd path/to/your/hooks/root/dir/overlord
export HOOK=hook-name
ln -s overlord "$HOOK" && mkdir "$HOOK".d

The script is able do this by itself, for multiple hooks at once. Just call it directly, passing the names of all the hooks to init.

cd path/to/your/hooks/root/dir/overlord
./overlord first-hook-name second-hook-name # ...

Usage

To print the manual:

./overlord -h

Now, any script within the hook-name.d directories will be executed when the corresponding hook is triggered, transparently receiving both the input and arguments of the hook.

Moreover, you can execute the hook-name script yourself to trigger all of them manually.

Daemonized hooks

For hooks that do not affect the outcome of the action (even through their exit status), the overlord script will execute all the hook-name.d scripts asynchronously, making those hooks non-blocking. However, the background execution will stop immediately if the current hook-name.d script exits with a non-zero status code.

The list of daemonized hooks can be found in the NOTES section of the script manual ./overlord -h.

overlord's People

Contributors

amartos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.