[yelp-tools] yelp-new: Fixed bashism and added bzr integration
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-tools] yelp-new: Fixed bashism and added bzr integration
- Date: Wed, 20 Apr 2011 16:03:47 +0000 (UTC)
commit 45b969adea43ea5649841319de86c991ccc829d6
Author: Shaun McCance <shaunm gnome org>
Date: Wed Apr 20 12:08:49 2011 -0400
yelp-new: Fixed bashism and added bzr integration
tools/yelp-new.in | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/tools/yelp-new.in b/tools/yelp-new.in
index 18d815d..507c940 100755
--- a/tools/yelp-new.in
+++ b/tools/yelp-new.in
@@ -105,11 +105,16 @@ else
fi
# Set up some variable for substitution
-username='YOUR NAME'
-useremail='YOUR EMAIL ADDRESS'
-if type -P git &>/dev/null; then
+if type git >/dev/null 2>&1; then
username=`git config user.name`
useremail=`git config user.email`
+elif type bzr >/dev/null 2>&1; then
+ username=`bzr whoami | sed -e 's/ <.*//'`
+ useremail=`bzr whoami --email`
+fi
+if [ "x$username" = "x" -a "x$useremail" = "x" ]; then
+ username='YOUR NAME'
+ useremail='YOUR EMAIL ADDRESS'
fi
pagetitle="$3"
if [ "x$pagetitle" = "x" ]; then
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]