From edf0e7e1593f202a69f3a7e3de891594a22a352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Mon, 24 Nov 2025 13:00:21 +0200 Subject: [PATCH] Delete clone.sh --- clone.sh | 116 ------------------------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 clone.sh diff --git a/clone.sh b/clone.sh deleted file mode 100644 index efaab1f97..000000000 --- a/clone.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -# Moutaz Muhammad - -# Git repository URL -REPO_URL="https://github.com/expsa/odex25-standard-modules.git" - -# Argument: which environment to clone (optional) -TARGET_ENV=$1 - -# Branch types and their corresponding directories -declare -A branch_dirs=( - ["dev"]="test" - ["preprod"]="preprod" - ["master"]="master" -) - -# All available branches -branches=( - "dev_odex-event" - "dev_odex25_accounting" - "dev_odex25_base" - "dev_odex25_dms" - "dev_odex25_fleet" - "dev_odex25_helpdesk" - "dev_odex25_hr" - "dev_odex25_inventory" - "dev_odex25_maintenance" - "dev_odex25_mobile" - "dev_odex25_pos" - "dev_odex25_project" - "dev_odex25_purchase" - "dev_odex25_realstate" - "dev_odex25_sales" - "dev_odex25_survey" - "dev_odex25_transactions" - "dev_odex25_website" - "dev_openeducat_erp-14.0.1.0" - "dev_odex25_takaful" - "dev_odex25_benefit" - "dev_odex25_donation" - "preprod_odex-event" - "preprod_odex25_accounting" - "preprod_odex25_base" - "preprod_odex25_dms" - "preprod_odex25_fleet" - "preprod_odex25_helpdesk" - "preprod_odex25_hr" - "preprod_odex25_inventory" - "preprod_odex25_maintenance" - "preprod_odex25_mobile" - "preprod_odex25_pos" - "preprod_odex25_project" - "preprod_odex25_purchase" - "preprod_odex25_realstate" - "preprod_odex25_sales" - "preprod_odex25_survey" - "preprod_odex25_transactions" - "preprod_odex25_website" - "preprod_openeducat_erp-14.0.1.0" - "preprod_odex25_takaful" - "preprod_odex25_benefit" - "preprod_odex25_donation" - "master_odex-event" - "master_odex25_accounting" - "master_odex25_base" - "master_odex25_dms" - "master_odex25_fleet" - "master_odex25_helpdesk" - "master_odex25_hr" - "master_odex25_inventory" - "master_odex25_maintenance" - "master_odex25_mobile" - "master_odex25_pos" - "master_odex25_project" - "master_odex25_purchase" - "master_odex25_realstate" - "master_odex25_sales" - "master_odex25_survey" - "master_odex25_transactions" - "master_odex25_website" - "master_openeducat_erp-14.0.1.0" - "master_odex25_donation" - "master_odex25_takaful" - "master_odex25_benefit" -) - -for branch in "${branches[@]}"; do - prefix="${branch%%_*}" # dev, preprod, master - folder_name="${branch#*_}" # odex25_xxx - base_dir="${branch_dirs[$prefix]}" - full_path="$base_dir/$folder_name" - - if [[ -n "$TARGET_ENV" && "${branch_dirs[$prefix]}" != "$TARGET_ENV" ]]; then - continue - fi - - if [[ -d "$full_path/.git" ]]; then - echo "Skipped $branch (already cloned)" - continue - elif [[ -d "$full_path" ]]; then - echo "⚠️ Found existing folder without .git for $branch, deleting and recloning..." - rm -rf "$full_path" - fi - - echo "Cloning $branch into $full_path..." - mkdir -p "$full_path" - git clone --depth=1 -b "$branch" "$REPO_URL" "$full_path" - - if [ $? -eq 0 ]; then - echo "✅ Successfully cloned $branch into $full_path" - else - echo "❌ Failed to clone $branch" - rm -rf "$full_path" # Cleanup if clone failed - fi -done