diff --git a/scripts/deploy/_deploy_lib.sh b/scripts/deploy/_deploy_lib.sh index 626ef7cc..addef5aa 100755 --- a/scripts/deploy/_deploy_lib.sh +++ b/scripts/deploy/_deploy_lib.sh @@ -13,8 +13,13 @@ push_to_remote() { return 1 fi + local push_args=() + if [ "$branch" = "main" ]; then + push_args+=("--force") + fi + echo "==========================================" - echo "git push $remote $branch ..." + echo "git push ${push_args[*]} $remote $branch ..." echo "==========================================" local current=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -29,7 +34,7 @@ push_to_remote() { return 1 fi - git push "$remote" "$branch" + git push "${push_args[@]}" "$remote" "$branch" if [ $? -eq 0 ]; then echo "=========================================="