diff --git a/gitUpdate.ps1 b/gitUpdate.ps1 index be75224..0886249 100644 --- a/gitUpdate.ps1 +++ b/gitUpdate.ps1 @@ -1,24 +1,28 @@ Clear-Host -# Pedir mensaje de commit (con soporte para saltos de línea) -Write-Host "Ingrese el mensaje de commit (presione Enter dos veces para finalizar):" +Write-Host "Opciones de commit:" -ForegroundColor Cyan +Write-Host "1. Pegar mensaje de commit (recomendado para mensajes largos)" +Write-Host "2. Escribir mensaje simple" Write-Host "" -$lineas = @() -do { - $linea = Read-Host - if ($linea -ne "") { - $lineas += $linea - } -} while ($linea -ne "") +$opcion = Read-Host "Seleccione una opción (1/2)" -$mensaje = $lineas -join "`n" +if ($opcion -eq "1") { + Write-Host "`nPASTE su mensaje de commit y presione CTRL+Z seguido de ENTER:" -ForegroundColor Yellow + $mensaje = @() + while ($line = Read-Host) { + $mensaje += $line + } + $mensajeFinal = $mensaje -join "`n" +} else { + $mensajeFinal = Read-Host "`nIngrese el mensaje de commit" +} Write-Host "`nAgregando archivos..." git add . Write-Host "Creando commit..." -git commit -m "$mensaje" +git commit -m $mensajeFinal Write-Host "Haciendo push a la rama develop..." $pushOutput = git push origin develop 2>&1