glone
One file long missing post-clone hook utility for git clone
.
- Run script after cloning is completed.
- Auto install git hooks.
Usage
Create .glone
file in your repository.
{
"install": "install.sh",
"hooks": {
"pre-commit" : "./pre-commit.js"
}
}
Your scripts can be any kind of file as long as have correct shebang in it.
install.sh
#!/bin/bash
echo "I'm running after cloning."
pre-commit.js
#! /usr/bin/env node
console.log('No commit for ya!')
process.exit(1);
Thats it!
Now when you're going to clone repo, just use npx glone
instead of git clone
.
npx glone <repository> [directory] -- [other git clone arguments]
Repository mandatory but directory and other git clone arguments are optional of course.
or install glone
globally and use standalone.
npm i glone -g
glone <repository> [directory] -- [other git clone arguments]
Try it with this repo:
npx glone git@github.com:ramesaliyev/glone.git