Version 5.12.15.test

PRUEBA
This commit is contained in:
2025-12-20 01:26:04 -06:00
parent 67e0b906dc
commit 246437fc98
2 changed files with 81 additions and 31 deletions

View File

@@ -18,7 +18,7 @@ Version=9.85
'###################### PUSH TORTOISE GIT #########################################################
'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=TortoiseGitProc&Args=/command:commit&Args=/path:"./../../"&Args=/closeonend:2
'###########################################################################################################
'Ctrl + clic para enviar Version: ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=-ExecutionPolicy&Args=Bypass&Args=-File&Args=%PROJECT%\_git_tag.ps1&Args=%PROJECT%&Args=%PROJECT_NAME%
'Ctrl + clic para Git: ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=-ExecutionPolicy&Args=Bypass&Args=-File&Args=..\_git_tag.ps1&Args=%22%PROJECT%%22&Args=%22%PROJECT_NAME%%22
#End Region
'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\

View File

@@ -1,45 +1,95 @@
param([string]$projectPath, [string]$projectName)
# --- SCRIPT DE AUTODESCUBRIMIENTO CON COMILLAS CORREGIDAS ---
$b4aFile = Join-Path $projectPath "$projectName.b4a"
if (-Not (Test-Path $b4aFile)) { return }
# 1. ¿DÓNDE ESTOY?
$projectPath = $PSScriptRoot
Write-Host "Buscando proyecto en: $projectPath"
# Extraer VersionName del código B4A [cite: 1495, 1502]
# 2. BUSCAR EL ARCHIVO .B4A
$b4aFileItem = Get-ChildItem -Path $projectPath -Filter "*.b4a" | Select-Object -First 1
if (-Not $b4aFileItem) {
Write-Error "ERROR: No hay archivo .b4a en esta carpeta."
Read-Host "Enter para salir"
return
}
$b4aFile = $b4aFileItem.FullName
$projectName = $b4aFileItem.BaseName
Write-Host "Proyecto: $projectName"
# --- 3. LIMPIEZA DE PROYECTO ---
#$objectsPath = Join-Path $projectPath "Objects"
#if (Test-Path $objectsPath) {
# Write-Host "Limpiando carpeta Objects..."
# Remove-Item -Path "$objectsPath\*" -Recurse -Force -ErrorAction SilentlyContinue
#}
# --- 4. LEER VERSIÓN ---
$versionLine = Get-Content $b4aFile | Select-String "#VersionName:"
if (-Not $versionLine) {
Write-Error "Falta #VersionName"
return
}
$version = ($versionLine -split ":")[1].Trim()
$tagName = "v$version"
Set-Location $projectPath
# --- 5. EJECUTAR COMMIT ---
$oldCommit = git rev-parse HEAD
# Abrir ventana de Commit de TortoiseGit [cite: 1226]
Write-Host "Esperando commit para version $version..."
$process = Start-Process "TortoiseGitProc.exe" -ArgumentList "/command:commit", "/path:`"$projectPath`"", "/logmsg:`"Version $version`"" -Wait -PassThru
Write-Host "----------------------------------------"
Write-Host "Versión: $version"
Write-Host "Abriendo TortoiseGit..."
# --- CORRECCIÓN AQUÍ: AGREGAMOS COMILLAS EXPLICITAS ---
# Usamos `" para que Tortoise reciba la ruta entre comillas
$tortoiseArgs = @(
"/command:commit",
"/path:`"$projectPath`"",
"/logmsg:`"Version $version`""
)
# Debug para que veas cómo queda ahora
Write-Host "Comando: TortoiseGitProc.exe $tortoiseArgs"
$process = Start-Process "TortoiseGitProc.exe" -ArgumentList $tortoiseArgs -Wait -PassThru
$newCommit = git rev-parse HEAD
if ($oldCommit -ne $newCommit) {
# Verificar si el Tag ya existe en el servidor (GitHub)
$tagExistsRemote = git ls-remote --tags origin $tagName
if ($tagExistsRemote) {
$confirm = Read-Host "El tag $tagName ya existe en GitHub. ¿Deseas SOBRESCRIBIRLO? (s/n)"
if ($confirm -ne "s") {
Write-Warning "Proceso abortado. Cambia la version en B4A y repite el proceso."
return
}
# Borrar local y remoto para permitir la actualizacion
git tag -d $tagName 2>$null
git push origin --delete $tagName 2>$null
}
# --- 6. LOGICA DE TAGS Y PUSH ---
if ($oldCommit -eq $newCommit) {
Write-Warning "Commit cancelado o sin cambios."
Start-Sleep -Seconds 2
return
}
# Crear nuevo Tag local
git tag -a $tagName -m "Release version $version"
Write-Host ">> Commit detectado."
$remoteTagInfo = git ls-remote --tags origin $tagName
if ($remoteTagInfo) {
Write-Warning "AVISO: El tag '$tagName' YA EXISTE en GitHub."
$confirm = Read-Host ">> ¿Deseas SOBRESCRIBIRLO? (s/n)"
# Subir cambios y el tag (usando -f solo para el tag si fuera necesario)
Write-Host "Subiendo cambios a GitHub..."
git push origin --follow-tags
Write-Host "¡Completado! Version $version actualizada en GitHub."
if ($confirm -eq "s") {
git tag -d $tagName 2>$null
git tag -a $tagName -m "Release version $version (Updated)"
Write-Host "Subiendo (Force)..."
git push origin
git push origin $tagName --force
Write-Host ">> Tag actualizado."
} else {
git push origin
Write-Host ">> Código subido (Tag no actualizado)."
}
} else {
Write-Warning "Commit cancelado. No se realizaron cambios."
}
git tag -a $tagName -m "Release version $version"
Write-Host "Subiendo..."
git push origin --follow-tags
Write-Host ">> Versión publicada."
}
Write-Host "----------------------------------------"
Start-Sleep -Seconds 3