Created
August 29, 2013 20:15
-
-
Save kassi/6382869 to your computer and use it in GitHub Desktop.
Excerpt of my .bash_functions: function ci
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
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