Skip to content

Instantly share code, notes, and snippets.

View sgnh's full-sized avatar
💪

Steffen Hansen sgnh

💪
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sgnh on github.
  • I am sgnh (https://keybase.io/sgnh) on keybase.
  • I have a public key ASCyrZdt4Z-5bZ6iNMA14G0xyRGv7McKz5s8u8wLD974WAo

To claim this, I am signing this object:

@sgnh
sgnh / post-checkout
Last active February 27, 2017 16:21
Git post-checkout hook for reinstalling yarn packages
#!/bin/bash
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
changed_files="$(git diff-tree -r --name-only --no-commit-id $PREVIOUS_HEAD $NEW_HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"