summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-config-profile14
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