Skip to content

Commit

Permalink
feat: add home resource repo
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Nov 5, 2024
1 parent 499d2b2 commit 87c03ec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion setup/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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' '[email protected]:cslant-community/home-resource.git'
}

0 comments on commit 87c03ec

Please sign in to comment.