56 lines
1.1 KiB
Batchfile
56 lines
1.1 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
cd /d "%~dp0"
|
|
|
|
set "BRANCH_NAME=passo3"
|
|
set "COMMIT_MSG=feat: aggiunge CLI unificata, build vocabolario e filtro lessicale"
|
|
|
|
if not "%~1"=="" (
|
|
set "COMMIT_MSG=%~1"
|
|
)
|
|
|
|
echo Repository: %cd%
|
|
echo Branch target: %BRANCH_NAME%
|
|
echo Commit message: %COMMIT_MSG%
|
|
echo.
|
|
|
|
git rev-parse --is-inside-work-tree >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo Errore: questa cartella non e' un repository Git.
|
|
exit /b 1
|
|
)
|
|
|
|
git show-ref --verify --quiet refs/heads/%BRANCH_NAME%
|
|
if errorlevel 1 (
|
|
echo Creo il branch %BRANCH_NAME%...
|
|
git checkout -b %BRANCH_NAME%
|
|
) else (
|
|
echo Il branch %BRANCH_NAME% esiste gia', ci passo sopra...
|
|
git checkout %BRANCH_NAME%
|
|
)
|
|
if errorlevel 1 exit /b 1
|
|
|
|
echo.
|
|
echo Aggiungo le modifiche...
|
|
git add .
|
|
if errorlevel 1 exit /b 1
|
|
|
|
echo.
|
|
echo Creo il commit...
|
|
git commit -m "%COMMIT_MSG%"
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo Nessun commit creato. Potrebbe non esserci nulla di nuovo da salvare.
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Eseguo il push del branch %BRANCH_NAME%...
|
|
git push -u origin %BRANCH_NAME%
|
|
if errorlevel 1 exit /b 1
|
|
|
|
echo.
|
|
echo Operazione completata con successo.
|
|
endlocal
|