This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Determine if the project dependencies have changed and install them if needed. | |
# (See below for an explanation of the `git` command being used here.) | |
NEW_GEMS=$(git diff-tree --name-only --no-commit-id --diff-filter=M ORIG_HEAD HEAD Gemfile Gemfile.lock) | |
[ -z "$NEW_GEMS" ] || (echo "Gemfile changed: installing updated dependences..." && bundle install) | |
# Get a list of new migration files that have been added since you last pulled. | |
# | |
# Check out `git help diff-tree` for full details, but the TL;DR is: | |
# `diff-tree`: show what is different between two project trees (as opposed to | |
# `diff`, which is more useful for diffing individual commits) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example approach to managing the JIRA ticket you are currently working on. | |
# This function simply manipulates an environment variable that can be read by other processes. | |
cj () { | |
local jira_config=$HOME/.jira | |
[[ -z "$jira_config" ]] || touch $jira_config # ensure it exists | |
. $jira_config # refresh the JIRA variable in the current session | |
local jira="$1" | |
# If no ticket specified, print the one currently being tracked. | |
[[ -z "$jira" ]] && echo "Now tracking $JIRA_CURRENT." && return 0 |