Sha256: 8bc1764c198ab9166122a72442ca6c1ede31759cb473bdc7ef86a645a2f66d46

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

#!/bin/bash

# Run updates on new changes
branch_name=$(git branch | grep "*" | sed "s/\* //")
reflog_message=$(git reflog -1)
merged_branch_name=$(echo $reflog_message | cut -d" " -f 4 | sed "s/://")

# if the merge was caused by a "git pull", we can safely ignore it
if [[ $reflog_message =~ "merge" ]]; then
  echo "We support only pull"
    exit 0
fi

if [[ $branch_name == "master" ]]; then
  bin/update
  bin/rake db:reset

# For crystalball gem usage
#  file=tmp/crystalball_data.yml
#  find $file -mtime +5 -exec rm {} \;
#
#  if [ ! -f "$file" ]; then
#    echo "Generete crystall ball index"
#    DISABLE_SPRING=1 CRYSTALBALL=true bin/rspec
#  fi

  echo "Removing merged branches..."
  git branch --merged master | grep -v "\*" | grep -v master | xargs -n 1 git branch -d
fi

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jt_tools-0.0.2 lib/install/bin/git-hooks/post-merge.sample