Created
March 20, 2018 15:40
-
-
Save PieterScheffers/f61a675152b4bf71d0abc6fd499cbda2 to your computer and use it in GitHub Desktop.
Pass Git variables via LC_* variables in SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Set GIT variables via LC variables | |
# LC gets default passed via ssh | |
# Put this in .bash_profile | |
if [[ -z "${GIT_AUTHOR_NAME}" ]]; then | |
if [[ -n "${LC_GIT_AUTHOR_NAME}" ]]; then | |
export GIT_AUTHOR_NAME="${LC_GIT_AUTHOR_NAME}" | |
fi | |
fi | |
if [[ -z "${GIT_AUTHOR_EMAIL}" ]]; then | |
if [[ -n "${LC_GIT_AUTHOR_EMAIL}" ]]; then | |
export GIT_AUTHOR_EMAIL="${LC_GIT_AUTHOR_EMAIL}" | |
fi | |
fi | |
if [[ -z "${GIT_COMMITTER_NAME}" ]]; then | |
if [[ -n "${LC_GIT_COMMITTER_NAME}" ]]; then | |
export GIT_COMMITTER_NAME="${LC_GIT_COMMITTER_NAME}" | |
fi | |
fi | |
if [[ -z "${GIT_COMMITTER_EMAIL}" ]]; then | |
if [[ -z "${LC_GIT_COMMITTER_EMAIL}" ]]; then | |
export GIT_COMMITTER_EMAIL="${LC_GIT_COMMITTER_EMAIL}" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment