aboutsummaryrefslogtreecommitdiff
path: root/commit-updates
blob: a6aa245da35a1093fc32cc0ea7c6c11743cf5512 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#
# Commit updates
#

# Parameters
ARGS="$*"

# Simply update commit
if git status &> /dev/null; then
  if [ ! -z "$1" ]; then
    commit "Updates $*"
  else
    commit "Updates $(basename `pwd`)"
  fi
else
  if [ ! -z "$1" ] && [ -d "$1" ]; then
    ( cd $1 &> /dev/null && commit "Updates $(basename $1)" )
  else
    mr commit -m "Updates"
  fi
fi