Captain makes easy to manage git hooks
if you want to install globally, use Mint
$ mint install yanamura/Captain
/// Package.swift
dependencies: [
...
.package(url: "https://github.com/yanamura/Captain"),
]
$ swift build --package-path <path to Package.swift> -c release
executable binary will be created to ./build/release/captain
create .captain
onproject root directory.
/ProjectDir
/.git
.gitignore
.captain
.git directory and .captain file should be in same location.
{
"pre-commit": "swift-format -r Sources -i"
}
or
{
"pre-commit": [
"swift-format -r Sources -i",
"git add ."
]
}
- applypatch-msg
- pre-applypatch
- post-applypatch
- pre-commit
- prepare-commit-msg
- commit-msg
- post-commit
- pre-rebase
- post-checkout
- post-merge
- pre-push
- pre-receive
- update
- post-receive
- post-update
- push-to-checkout
- pre-auto-gc
- post-rewrite
- sendemail-validat
$ captain install
/// Package.swift
dependencies: [
...
.package(url: "https://github.com/yanamura/Captain"),
]
$ swift run --package-path <path to Package.swift> -c release captain install
Using Mint
$ mint run yanamura/Captain captain install
$ captain uninstall