mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 13:43:46 +00:00
add git deploy key wrapper functionality
This commit is contained in:
parent
73d2440ad4
commit
17860381fc
9 changed files with 88 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
# The last argument is the command to be executed on the remote end, which is something
|
||||
# like "git-upload-pack 'webfactory/ssh-agent.git'". We need the repo path only, so we
|
||||
# Terraform ends up bing "git-upload-pack '/webfactory/ssh-agent.git'"
|
||||
# loop over this last argument to get the last part of if.
|
||||
for last in ${!#}; do :; done
|
||||
|
||||
|
@ -12,6 +13,9 @@ trap "rm -f $key_file" EXIT
|
|||
eval last=$last
|
||||
|
||||
# Try to pick the right key
|
||||
ssh-add -L | grep --word-regexp --max-count=1 $last > $key_file
|
||||
# No "--word-regexp" because Terraforms usage of git ends up as
|
||||
# "git-upload-pack 'webfactory/ssh-agent.git'". "--word-regexp" will not match it.
|
||||
# Other integrations still work without "--word-regexp"
|
||||
ssh-add -L | grep --max-count=1 $last > $key_file
|
||||
|
||||
ssh -i $key_file "$@"
|
||||
ssh -i $key_file "$@"
|
Loading…
Add table
Add a link
Reference in a new issue