Skip to content

Instantly share code, notes, and snippets.

@kassi
Created August 29, 2013 20:15
Show Gist options
  • Save kassi/6382869 to your computer and use it in GitHub Desktop.
Save kassi/6382869 to your computer and use it in GitHub Desktop.
Excerpt of my .bash_functions: function ci
function ci {
command="$*"
filename="/tmp/ci-$RANDOM-$$"
if [ "$1" == "rails" -a "$2" == "new" -a -n "$3" ]; then
echo "Initialize new rails app" > $filename
echo >> $filename
echo "Command:" >> $filename
echo " $command" >> $filename
$command && cd "$3" && git init && git add . && git commit -a -F $filename
if [ -n "$EDITOR" ]; then
$EDITOR . Gemfile
fi
else
echo > $filename
echo >> $filename
echo "Command:" >> $filename
echo " $command" >> $filename
$command && git add . && git commit -a -t $filename && s -a $(git show --name-only --pretty="format:")
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment