aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-14 10:53:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-14 10:53:09 -0300
commit15fbe5a432a361cc9c7a628aaae7c041263d3086 (patch)
tree20085f331b7d174ccb10a7548c3bc1013cc66c90
parent301b02acc4d165548d8209dd5b5e2f214dcde765 (diff)
downloadkeyringer-15fbe5a432a361cc9c7a628aaae7c041263d3086.tar.gz
keyringer-15fbe5a432a361cc9c7a628aaae7c041263d3086.tar.bz2
Check git configuration
-rwxr-xr-xkeyringer18
1 files changed, 17 insertions, 1 deletions
diff --git a/keyringer b/keyringer
index da87678..161ab5e 100755
--- a/keyringer
+++ b/keyringer
@@ -39,6 +39,18 @@ function keyringer_init {
exit 1
fi
+ # Check user configuration: git might complain if those aren't set
+ if [ -z "`git config --global --get user.name`" ] || [ -z "`git config --global --get user.email`" ]; then
+ echo "Please chose the name and email address that should identify your changes in the new keyring."
+ read -p "Enter your desired name/pseudonym: " name
+ read -p "Enter your desired email address: " email
+
+ if [ -z "$name" ] || [ -z "$email" ]; then
+ echo "Aborting."
+ exit 1
+ fi
+ fi
+
# Setup
if [ ! -z "$URL" ]; then
git clone "$URL" "$BASEDIR"
@@ -93,6 +105,10 @@ function keyringer_init {
keyringer_exec git "$BASEDIR" init
keyringer_git_ignore 'tmp/*'
+ # Git configuration
+ git config user.email "$email"
+ git config user.name "$name"
+
# Edit default recipients
echo "Now you have to edit the default recipient configuration to be able to encrypt secrets."
echo "Press any key to proceed editing..."
@@ -161,7 +177,7 @@ fi
# Load functions
source "$LIB" || exit 1
-# Check if keyring exist
+# Check if keyring exists
if [ ! -f "$CONFIG_BASE/$KEYRING" ] && [ "$ACTION" != "init" ]; then
echo "No such keyring $KEYRING"
exit 1