Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
8bitDesigner / 1.md
Last active February 1, 2024 06:42
Git post-merge hook which, when you run `git merge` or `git pull` will then `bundle` if the project's Gemfile changed, or `npm install` if the project's package.json changed.Inspired and based off of https://gist.github.com/bumi/5706550

Make bundleing and npm installing easy

This repo has some handy handy hooks to run bundle or npm install whenever you:

  • git checkout a new branch with a different Gemfile or package.json
  • git pull a change to Gemfile or package.json

How can I has this!!?

  1. git clone https://gist.github.com/5869846.git hooks && cd hooks && chmod +x install
#!/bin/sh
# Update latest stable version, use it and migrate npm packages.
PREV_VER=$(nodebrew ls|grep current:|cut -d ' ' -f 2)
echo "Current version: $PREV_VER"
echo ""
echo "nodebrew install-binary stable"
nodebrew install-binary stable
if [ $? -ne 0 ]; then
# Already installed
fizz = function f() {
fizz = function () {
fizz = function () {
fizz = f
return "Fizz"
}
}
}
buzz = function f() {