Each one builds on the previous, ie. I re-use constants defined earlier.
HOURS_IN_DAY = 24
DAYS_IN_YEAR = 365.242199
HOURS_IN_YEAR = HOURS_IN_DAY * DAYS_IN_YEAR
puts "Hours in an astronomical year: #{HOURS_IN_YEAR}"
function error_message { | |
echo -e >&2 \ | |
"---------------------------------------------------------------------------------------------------------" \ | |
"\n$1" \ | |
"\n---------------------------------------------------------------------------------------------------------" | |
} | |
function undo_merge { | |
error_message "Undoing your merge. Please fix the problem and try again." |
--type-add=ruby=.haml,sass=.sass |
current_git_branch() { | |
git_exists=`git branch 2>/dev/null | sed -ne'/^\* /s///p'` | |
if [[ "$git_exists" != "" ]]; then | |
if [[ "$git_exists" == "(no branch)" ]]; then | |
git_exists="\e[31m\]$git_exists\e[0m\]" | |
fi | |
echo "$git_exists " | |
fi | |
unset git_exists |