sync.sh 899 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. source "$(dirname "$0")/common.sh"
  3. product_code_list=("nomo")
  4. for product_code in "${product_code_list[@]}"; do
  5. echo "${MAGENTA}正在同步 ${product_code} 相关分支...${RESET}"
  6. execute_command "git checkout ${product_code}-prod" "切换至 ${product_code}-prod 分支失败"
  7. execute_command "git pull" "拉取 ${product_code}-prod 分支失败"
  8. execute_command "git checkout ${product_code}-test" "切换至 ${product_code}-test 分支失败"
  9. execute_command "git pull" "拉取 ${product_code}-test 分支失败"
  10. execute_command "git checkout main" "切换至 main 分支失败"
  11. execute_command "git pull" "拉取 main 分支失败"
  12. execute_command "git checkout nomo-dev" "切换至 nomo-dev 分支失败"
  13. execute_command "git pull" "拉取 nomo-dev 分支失败"
  14. done
  15. execute_command "git checkout xiaom" "切换至 xiaom 分支失败"