Skip to content

Instantly share code, notes, and snippets.

@ricardopereira
Created August 7, 2016 01:50
Show Gist options
  • Save ricardopereira/6be66f0f454bcbd6d52b49fb872445cc to your computer and use it in GitHub Desktop.
Save ricardopereira/6be66f0f454bcbd6d52b49fb872445cc to your computer and use it in GitHub Desktop.
"Bootstrap script that will allow you to have git hook inside your repository and make it easy for the whole team to be in sync." http://merowing.info/2016/08/setting-up-pre-commit-hook-for-ios/
#!/usr/bin/env bash
# Usage: scripts/bootstrap
set -eu
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR/.."
ln -s "$ABSOLUTE_PATH/pre-commit.sh" .git/hooks/pre-commit
@ricardopereira
Copy link
Author

ricardopereira commented Aug 7, 2016

"Assumes that both pre-commit.sh and bootstrap files under Scripts folder in your repo."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment