#!/bin/bash # # Commit updates # # Parameters PROJECT="$1" # Git application we use GIT="hit" # Check if param is a project if [ ! -z "$PROJECT" ] && [ -z "$2" ] && ( cd $PROJECT &> /dev/null ); then if ! $GIT status &> /dev/null; then cd $PROJECT &> /dev/null shift elif ! $GIT status $PROJECT | grep -q "$PROJECT (new commits)"; then cd $PROJECT &> /dev/null shift fi fi # Commit message ARGS="$*" # Simply update commit if $GIT status &> /dev/null; then if [ ! -z "$ARGS" ]; then commit "Updates $ARGS" else commit "Updates $(basename "`pwd`")" fi else mr commit -m "Updates" mr fetch fi