mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadido script bat para automatizar los commits al repositorio
This commit is contained in:
38
sk-commit.bat
Normal file
38
sk-commit.bat
Normal file
@ -0,0 +1,38 @@
|
||||
@echo off
|
||||
|
||||
REM Obtener la fecha y hora actual
|
||||
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a
|
||||
set year=%datetime:~0,4%
|
||||
set month=%datetime:~4,2%
|
||||
set day=%datetime:~6,2%
|
||||
set hour=%datetime:~8,2%
|
||||
set minute=%datetime:~10,2%
|
||||
set second=%datetime:~12,2%
|
||||
|
||||
REM Formatear la fecha y hora
|
||||
set fecha_hora=%year%-%month%-%day% %hour%:%minute%:%second%
|
||||
|
||||
REM Mensaje de commit automático
|
||||
set mensaje_automatico=Actualizacion automatica: %fecha_hora%
|
||||
|
||||
REM Solicitar al usuario un mensaje personalizado
|
||||
set /p mensaje_usuario=Ingrese un mensaje personalizado (o presione Enter para el automatico):
|
||||
|
||||
REM Utilizar el mensaje automático si no se proporciona uno
|
||||
if "%mensaje_usuario%"=="" (
|
||||
set mensaje_commit=%mensaje_automatico%
|
||||
) else (
|
||||
set mensaje_commit=%mensaje_usuario%
|
||||
)
|
||||
|
||||
REM Añadir todos los cambios al área de preparación
|
||||
git add .
|
||||
|
||||
REM Realizar el commit con el mensaje seleccionado
|
||||
git commit -m "%mensaje_commit%"
|
||||
|
||||
REM Subir al respositorio remoto
|
||||
git push
|
||||
|
||||
REM Imprimir mensaje informativo
|
||||
echo Se ha realizado el commit con el mensaje: %mensaje_commit%
|
||||
Reference in New Issue
Block a user