mtdowling / git-rook Goto Github PK
View Code? Open in Web Editor NEWgit r(un h)ook: execute multiple scripts for a single git hook
License: MIT License
git r(un h)ook: execute multiple scripts for a single git hook
License: MIT License
running make test
before adding to my path produced the following 2 errors.
✗ can install hooks to current repo
(in test file test/git-rook.bats, line 41)
`[ $status -eq 0 ]' failed
Initialized empty Git repository in /private/var/folders/b5/4344qh3518nf3dp58nnphd8r0000gn/T/test-repo/.git/
/Users/masukomi/workspace/reference/bash/git-rook
/Users/masukomi/workspace/reference/bash/git-rook
✗ can install hooks to specific repo
(in test file test/git-rook.bats, line 50)
`[ $status -eq 0 ]' failed
Initialized empty Git repository in /private/var/folders/b5/4344qh3518nf3dp58nnphd8r0000gn/T/test-repo/.git/
/Users/masukomi/workspace/reference/bash/git-rook
/Users/masukomi/workspace/reference/bash/git-rook
The problem is a result of this section in install_hook
if [ -f "${dest}" ]; then
[ "${FORCE}" -eq 0 ] && fail "${dest} exists (use -f to force)" && exit 1
echo " ! Overwriting ${dest}"
fi
If your git template directory has any hooks in it already, then running git init
will copy those down into the current repo. Obviously the intersection of these two things isn't the greatest use-case. I think the solution is to have git-rook's initialize functionality check if there is a git template directory specified via any of the 3 ways specified in the docs, and if so, check if there are any hooks in it.
Then the question is, should git-rook bail? or should it remove / replace those files that were copied over from the templates directory?
Another solution might be to always move existing files and throw up a notice. So, for example, if there's a pre-commit
file there already it'd be renamed something like pre-commit.rook-bak
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.