summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-26 19:19:14 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-26 19:19:14 -0500
commit8e4aa31eb303dc0086e9a4f535efda9a6d3939e0 (patch)
treef8bf7c340891ef78c06b4a04536242057202f3c4
parent69335b6ff0342a2d3201158b9a18010c57cbcf26 (diff)
Commit files working for git
-rwxr-xr-xlibrecommit24
1 files changed, 13 insertions, 11 deletions
diff --git a/librecommit b/librecommit
index 9444bd9..d9a9164 100755
--- a/librecommit
+++ b/librecommit
@@ -27,36 +27,38 @@ usage () {
echo
echo "This script commits the package using name, pkgver an pkgver"
echo
+ exit 1
}
-msg='Commiting libre package $pkg-$pkgver-$pkgrel'
-files=""
+msg="Commiting libre package \"\$pkg-\$pkgver-\$pkgrel\""
for opt in $@ ; do
case ${opt} in
- h) usage ;;
- m) msg=${OPTARG} ;;
- *) files+="${opt} " ;;
+ -h) usage ;;
+ -m) shift; msg=${1}; shift ;;
+ *) files+="${1} " ; shift ;;
esac
done
-if [ ! -e PKGBUILD ]; then exit 1; fi
+if [ ! -e PKGBUILD -o -z "$files" ]; then usage; fi
source PKGBUILD
pkg=${pkgbase:-${pkgname}}
-if [ ${COMMITCD} = 'git' ]; then
+msg=$(eval echo $msg)
- ${COMMITCD} add $@ && ${COMMITCD} -m ""
+if [ "$COMMITCMD" = 'git' ]; then
-elif [ ${COMMITCD} = 'hg' ]; then
+ ${COMMITCMD} add ${files} && ${COMMITCMD} commit -m "$(echo $msg)"
- ${COMMITCMD} commit $@ -m -v || exit 1
+elif [ "$COMMITCMD" = 'hg' ]; then
+
+ ${COMMITCMD} commit ${files} -m "$msg" -v || exit 1
else
- error "COMMITCD is not correctly set on libretools.conf"
+ error "COMMITCMD is not correctly set on libretools.conf"
fi