-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-config.sh
More file actions
executable file
·36 lines (25 loc) · 1.03 KB
/
git-config.sh
File metadata and controls
executable file
·36 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Git configuration
# Git user config to set the user email and name.
export COL_PROP_LENGTH=8
# Git User Email
# Env name should be uppercase without minus
EMAIL_VAR="${DEVF_PREFIX}_${ORGANIZATION_ENV_NAME}_EMAIL"
EMAIL_VALUE="${!EMAIL_VAR:-}"
if devf_check_env_var "$EMAIL_VAR" "$EMAIL_VALUE" "$USER_ENV_SCOPE"; then
git config user.email "$EMAIL_VALUE"
devf_print_props "Email" "$EMAIL_VALUE"
else
devf_echo_yellow " No git email configured. $EMAIL_VAR variable is empty"
fi
# Git signing key is the long format dir
# gpg --list-secret-keys --keyid-format=long
SIGNING_KEY_VAR="${DEVF_PREFIX}_${ORGANIZATION_ENV_NAME}_SIGNING_KEY"
SIGNING_KEY_VALUE="${!SIGNING_KEY_VAR:-}"
if devf_check_env_var "$SIGNING_KEY_VAR" "$SIGNING_KEY_VALUE" "$USER_ENV_SCOPE"; then
git config user.signingkey "$SIGNING_KEY_VALUE"
devf_print_props "GPG Key" "$SIGNING_KEY_VALUE"
git config commit.gpgsign true
devf_print_props "GPG Sign" "true"
else
devf_echo_yellow " No git pgp signing key configured. $SIGNING_KEY_VAR variable is empty"
fi