This file contains hidden or 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
# useful bits to remove temp files in shell scripts | |
FILE=$(mktemp) | |
function remove_temp_output { | |
rm $FILE | |
} | |
trap remove_temp_output EXIT |
This file contains hidden or 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
# Assumes releases are tagged with "vMAJOR.MINOR.PATCH" (semver) | |
# The first sed removes the leading "v" (this step is not entirely necessary) | |
# The second sed uses the "number of commits since tag" to create a dev version and uses the sha as the "local version" | |
# | |
# If the second sed fails, it will just print the returns of the first sed | |
# | |
# Sample output: | |
# 0.3.0.dev1+g7a45b05 | |
# 0.3.0.dev3+g8418ac6.dirty | |
# 2.7.1rc2.dev17.dirty |
This file contains hidden or 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
# to bootstrap, run `brew install git bash-completion` | |
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion | |
if hash brew 2>/dev/null; then | |
export HOMEBREW_CASK_OPTS="--appdir=~/Applications" | |
fi |