diff options
author | Alex Born <alex@velosgt.com> | 2022-07-08 00:43:12 -0500 |
---|---|---|
committer | Alex Born <alex@velosgt.com> | 2022-07-08 00:46:19 -0500 |
commit | b762f9f2b2b5644718ce3e58a6e2c1a39efbcf02 (patch) | |
tree | afa3eda8fb5e1181d0c53a2997f2ab0352436806 | |
parent | dbd92590ff09a2a13a9a4b89b09e1dd50e0e2fe4 (diff) | |
download | git-config-profile-main.tar.xz git-config-profile-main.zip |
-rwxr-xr-x | git-config-profile | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/git-config-profile b/git-config-profile index a2f4a93..308897d 100755 --- a/git-config-profile +++ b/git-config-profile @@ -34,6 +34,7 @@ cmd() { PROFILES=() REQ_PROFILE="" INIT_REPO="" +CLONE_REPO="" PROFILES_FILE="/etc/default/git-config-profiles" config_profile() { @@ -53,6 +54,8 @@ config_profile() { if [[ -n "${INIT_REPO}" ]]; then cmd git init + elif [[ -n "${CLONE_REPO}" ]]; then + GIT_SSH_COMMAND="ssh -i ${ssh_key}" cmd git clone "${CLONE_REPO}" . fi cmd git config --local user.name "$name"; @@ -73,7 +76,7 @@ get_profile() { } die_usage() { - die "Usage: $PROGRAM [get|list|config|init] (profile)"; + die "Usage: $PROGRAM [get|list|config|init|clone] (profile) [url]"; } if [[ "$#" -eq 1 && "$1" = "list" ]]; then @@ -91,6 +94,15 @@ elif [[ "$#" -eq 2 ]]; then die_usage; fi +elif [[ "$#" -eq 3 ]]; then + + if [[ "$1" = "clone" ]]; then + REQ_PROFILE="$2" + CLONE_REPO="$3" + else + die_usage; + fi + else die_usage; fi |