diff --git a/setup/git.sh b/setup/git.sh index dd754eb..33e3da8 100644 --- a/setup/git.sh +++ b/setup/git.sh @@ -13,10 +13,15 @@ home_sync() { home_api_sync ;; + resources) + home_resources_sync + ;; + all) if [ "$USE_SUBMODULES" = true ]; then clone_submodules else + home_resources_sync home_fe_sync home_api_sync fi @@ -40,6 +45,7 @@ clone_submodules() { repo_sync_template() { REPO_NAME="$1" REPO_DIR="${2:-}" + GIT_REPO_URL="${3:-}" if [ -z "$REPO_DIR" ]; then REPO_DIR="$REPO_NAME" @@ -49,7 +55,12 @@ repo_sync_template() { cd "$HOME_DIR" || exit if [ -z "$(ls -A "$REPO_DIR")" ]; then echo " ∟ Cloning $REPO_NAME repository..." - git clone "$GIT_SSH_URL"/"$REPO_NAME".git "$REPO_DIR" + + if [ -z "$GIT_REPO_URL" ]; then + git clone "$GIT_SSH_URL/$REPO_NAME.git" "$REPO_DIR" + else + git clone "$GIT_REPO_URL" "$REPO_DIR" + fi else echo " ∟ Pulling $REPO_NAME repository..." cd "$HOME_DIR/$REPO_DIR" || exit @@ -67,3 +78,7 @@ home_fe_sync() { home_api_sync() { repo_sync_template 'home-api' } + +home_resources_sync() { + repo_sync_template 'home-resource' 'home-resource' 'git@github.com:cslant-community/home-resource.git' +}