diff --git a/docs/command-line.rst b/docs/command-line.rst index d2a7298..91e4d6f 100644 --- a/docs/command-line.rst +++ b/docs/command-line.rst @@ -68,5 +68,9 @@ Environment variables | ``AWS_CONFIG_FILE`` | Path to the awscli configuration and credentials | | |aws_cred| | file that are copied to the kas home dir. | +-----------------------+-----------------------------------------------------+ +| |git_cred| | Allows to set the git credential helper in the | +| | `.gitconfig` of the kas user. | ++-----------------------+-----------------------------------------------------+ .. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE`` +.. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER`` diff --git a/kas/libcmds.py b/kas/libcmds.py index d084567..9f43955 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -164,6 +164,11 @@ class SetupHome(Command): fds.write('[User]\n' '\temail = kas@example.com\n' '\tname = Kas User\n') + if os.environ.get('GIT_CREDENTIAL_HELPER', False): + fds.write('[credential]\n' + '\thelper = ' + + os.environ.get('GIT_CREDENTIAL_HELPER') + + '\n') if os.environ.get('AWS_CONFIG_FILE', False) \ and os.environ.get('AWS_SHARED_CREDENTIALS_FILE', False):