forgegit 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/init.cmd CHANGED
@@ -1,191 +1,200 @@
1
- @echo off
2
- setlocal EnableDelayedExpansion
3
- chcp 65001 >nul 2>nul
4
-
5
- cd /d "%~dp0"
6
- cls
7
-
8
- set "ROOT=%~dp0"
9
-
10
- REM --- Detectar donde esta lib/ y templates/ ---
11
- if exist ".forge\lib\ui.cmd" (
12
- set "LIB=%ROOT%.forge\lib"
13
- set "TPL=%ROOT%.forge\templates"
14
- set "CMDS=%ROOT%.forge\commands"
15
- ) else (
16
- set "LIB=%ROOT%lib"
17
- set "TPL=%ROOT%templates"
18
- set "CMDS=%ROOT%.forge\commands"
19
- )
20
-
21
- REM --- Force mode ---
22
- set "FORCE=0"
23
- if /i "%~1"=="--force" set "FORCE=1"
24
- if /i "%~1"=="force" set "FORCE=1"
25
- if /i "%~1"=="-f" set "FORCE=1"
26
-
27
- call "%ROOT%config.cmd"
28
-
29
- for %%a in ("%CD%") do set "PROJECT_NAME=%%~nxa"
30
-
31
- call "%LIB%\ui.cmd" banner
32
-
33
- REM --- STEP 1/16: Node.js ---
34
- where node >nul 2>nul
35
- if errorlevel 1 (
36
- echo [1/16] Node.js MISSING
37
- echo Descargalo desde: https://nodejs.org/
38
- goto :abort
39
- )
40
- for /f "tokens=*" %%v in ('node --version 2^>nul') do set "NODE_VER=%%v"
41
- call "%LIB%\ui.cmd" step 1/16 "Node.js !NODE_VER!" "OK"
42
-
43
- REM --- STEP 2/16: Git ---
44
- where git >nul 2>nul
45
- if errorlevel 1 (
46
- echo [2/16] Git MISSING
47
- echo Descargalo desde: https://git-scm.com/download/win
48
- goto :abort
49
- )
50
- for /f "tokens=*" %%v in ('git --version 2^>nul') do set "GIT_VER=%%v"
51
- call "%LIB%\ui.cmd" step 2/16 "!GIT_VER!" "OK"
52
-
53
- REM --- STEP 3/16: Init repo ---
54
- call "%LIB%\git-ops.cmd" init
55
-
56
- REM --- STEP 4/16: Branch main ---
57
- call "%LIB%\git-ops.cmd" branch_main
58
-
59
- REM --- STEP 5/16: Crear estructura .forge/ ---
60
- if exist ".forge\commands" goto :step5_ok
61
- mkdir ".forge" 2>nul
62
- mkdir ".forge\commands" 2>nul
63
- mkdir ".forge\lib" 2>nul
64
- mkdir ".forge\templates" 2>nul
65
- call "%LIB%\ui.cmd" step 5/16 "Estructura .forge/" "CREADO"
66
- goto :step6
67
- :step5_ok
68
- call "%LIB%\ui.cmd" step 5/16 "Estructura .forge/" "YA EXISTE"
69
-
70
- :step6
71
- REM --- STEP 6/16: .gitignore ---
72
- if exist ".gitignore" goto :step6_ok
73
- call "%LIB%\templates.cmd" write_gitignore
74
- call "%LIB%\ui.cmd" step 6/16 ".gitignore universal" "CREADO"
75
- goto :step7
76
- :step6_ok
77
- call "%LIB%\ui.cmd" step 6/16 ".gitignore" "YA EXISTE"
78
-
79
- :step7
80
- REM --- STEP 7/16: README.md ---
81
- if exist "README.md" goto :step7_ok
82
- call "%LIB%\templates.cmd" write_readme
83
- call "%LIB%\ui.cmd" step 7/16 "README.md adaptativo" "CREADO"
84
- goto :step8
85
- :step7_ok
86
- call "%LIB%\ui.cmd" step 7/16 "README.md" "YA EXISTE"
87
-
88
- :step8
89
- REM --- STEP 8/16: forge.cmd ---
90
- if exist "forge.cmd" goto :step8_ok
91
- call "%LIB%\templates.cmd" write_forge
92
- call "%LIB%\ui.cmd" step 8/16 "forge.cmd menu" "CREADO"
93
- goto :step9
94
- :step8_ok
95
- call "%LIB%\ui.cmd" step 8/16 "forge.cmd" "YA EXISTE"
96
-
97
- :step9
98
- REM --- STEP 9/16: save.cmd ---
99
- if exist ".forge\commands\save.cmd" goto :step9_ok
100
- call "%LIB%\templates.cmd" write_save
101
- call "%LIB%\ui.cmd" step 9/16 "save.cmd" "CREADO"
102
- goto :step10
103
- :step9_ok
104
- call "%LIB%\ui.cmd" step 9/16 "save.cmd" "YA EXISTE"
105
-
106
- :step10
107
- REM --- STEP 10/16: push.cmd ---
108
- if exist ".forge\commands\push.cmd" goto :step10_ok
109
- call "%LIB%\templates.cmd" write_push
110
- call "%LIB%\ui.cmd" step 10/16 "push.cmd" "CREADO"
111
- goto :step11
112
- :step10_ok
113
- call "%LIB%\ui.cmd" step 10/16 "push.cmd" "YA EXISTE"
114
-
115
- :step11
116
- REM --- STEP 11/16: snapshots.cmd ---
117
- if exist ".forge\commands\snapshots.cmd" goto :step11_ok
118
- call "%LIB%\templates.cmd" write_snapshots
119
- call "%LIB%\ui.cmd" step 11/16 "snapshots.cmd" "CREADO"
120
- goto :step12
121
- :step11_ok
122
- call "%LIB%\ui.cmd" step 11/16 "snapshots.cmd" "YA EXISTE"
123
-
124
- :step12
125
- REM --- STEP 12/16: historial.cmd ---
126
- if exist ".forge\commands\historial.cmd" goto :step12_ok
127
- call "%LIB%\templates.cmd" write_historial
128
- call "%LIB%\ui.cmd" step 12/16 "historial.cmd" "CREADO"
129
- goto :step13
130
- :step12_ok
131
- call "%LIB%\ui.cmd" step 12/16 "historial.cmd" "YA EXISTE"
132
-
133
- :step13
134
- REM --- STEP 13/16: abrir.cmd ---
135
- if exist ".forge\commands\abrir.cmd" goto :step13_ok
136
- call "%LIB%\templates.cmd" write_abrir
137
- call "%LIB%\ui.cmd" step 13/16 "abrir.cmd" "CREADO"
138
- goto :step14
139
- :step13_ok
140
- call "%LIB%\ui.cmd" step 13/16 "abrir.cmd" "YA EXISTE"
141
-
142
- :step14
143
- REM --- STEP 14/16: auditar.cmd ---
144
- if exist ".forge\commands\auditar.cmd" goto :step14_ok
145
- call "%LIB%\templates.cmd" write_auditar
146
- call "%LIB%\ui.cmd" step 14/16 "auditar.cmd" "CREADO"
147
- goto :step15
148
- :step14_ok
149
- call "%LIB%\ui.cmd" step 14/16 "auditar.cmd" "YA EXISTE"
150
-
151
- :step15
152
- REM --- STEP 15/16: Commit ---
153
- call "%LIB%\git-ops.cmd" has_changes
154
- if errorlevel 1 (
155
- set "USER_MSG="
156
- set /p "USER_MSG= Mensaje del commit [Enter = default]: "
157
- if "!USER_MSG!"=="" set "USER_MSG=%COMMIT_MESSAGE%"
158
- call "%LIB%\git-ops.cmd" commit "!USER_MSG!"
159
- call "%LIB%\ui.cmd" step 15/16 "Commit: !USER_MSG!" "CREADO"
160
- ) else (
161
- call "%LIB%\ui.cmd" step 15/16 "Sin cambios para commit" "SKIP"
162
- )
163
-
164
- REM --- STEP 16/16: Tag ---
165
- call "%LIB%\git-ops.cmd" tag
166
- if errorlevel 1 (
167
- call "%LIB%\ui.cmd" step 16/16 "Tag %TAG_INITIAL%" "CREADO"
168
- ) else (
169
- call "%LIB%\ui.cmd" step 16/16 "Tag %TAG_INITIAL%" "YA EXISTE"
170
- )
171
-
172
- call "%LIB%\ui.cmd" done
173
- call :shell_if_double_click
174
- endlocal
175
- exit /b 0
176
-
177
- :abort
178
- call "%LIB%\ui.cmd" abort
179
- call :shell_if_double_click
180
- endlocal
181
- exit /b 1
182
-
183
- :shell_if_double_click
184
- if "%NO_PAUSE%"=="1" goto :eof
185
- echo %cmdcmdline% | find /i "%~nx0" >nul
186
- if errorlevel 1 goto :eof
187
- echo.
188
- echo Sesion interactiva abierta. Escribe 'exit' para cerrar.
189
- echo.
190
- cmd /k
1
+ @echo off
2
+ setlocal EnableDelayedExpansion
3
+ chcp 65001 >nul 2>nul
4
+
5
+ cd /d "%~dp0"
6
+ cls
7
+
8
+ set "ROOT=%~dp0"
9
+
10
+ REM --- Detectar donde esta lib/ y templates/ ---
11
+ if exist ".forge\lib\ui.cmd" (
12
+ set "LIB=%ROOT%.forge\lib"
13
+ set "TPL=%ROOT%.forge\templates"
14
+ set "CMDS=%ROOT%.forge\commands"
15
+ ) else (
16
+ set "LIB=%ROOT%lib"
17
+ set "TPL=%ROOT%templates"
18
+ set "CMDS=%ROOT%.forge\commands"
19
+ )
20
+
21
+ REM --- Force mode ---
22
+ set "FORCE=0"
23
+ if /i "%~1"=="--force" set "FORCE=1"
24
+ if /i "%~1"=="force" set "FORCE=1"
25
+ if /i "%~1"=="-f" set "FORCE=1"
26
+
27
+ call "%ROOT%config.cmd"
28
+
29
+ for %%a in ("%CD%") do set "PROJECT_NAME=%%~nxa"
30
+
31
+ call "%LIB%\ui.cmd" banner
32
+
33
+ REM --- STEP 1/17: Node.js ---
34
+ where node >nul 2>nul
35
+ if errorlevel 1 (
36
+ echo [1/17] Node.js MISSING
37
+ echo Descargalo desde: https://nodejs.org/
38
+ goto :abort
39
+ )
40
+ for /f "tokens=*" %%v in ('node --version 2^>nul') do set "NODE_VER=%%v"
41
+ call "%LIB%\ui.cmd" step 1/17 "Node.js !NODE_VER!" "OK"
42
+
43
+ REM --- STEP 2/17: Git ---
44
+ where git >nul 2>nul
45
+ if errorlevel 1 (
46
+ echo [2/17] Git MISSING
47
+ echo Descargalo desde: https://git-scm.com/download/win
48
+ goto :abort
49
+ )
50
+ for /f "tokens=*" %%v in ('git --version 2^>nul') do set "GIT_VER=%%v"
51
+ call "%LIB%\ui.cmd" step 2/17 "!GIT_VER!" "OK"
52
+
53
+ REM --- STEP 3/17: Init repo ---
54
+ call "%LIB%\git-ops.cmd" init
55
+
56
+ REM --- STEP 4/17: Branch main ---
57
+ call "%LIB%\git-ops.cmd" branch_main
58
+
59
+ REM --- STEP 5/17: Crear estructura .forge/ ---
60
+ if exist ".forge\commands" goto :step5_ok
61
+ mkdir ".forge" 2>nul
62
+ mkdir ".forge\commands" 2>nul
63
+ mkdir ".forge\lib" 2>nul
64
+ mkdir ".forge\templates" 2>nul
65
+ call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "CREADO"
66
+ goto :step6
67
+ :step5_ok
68
+ call "%LIB%\ui.cmd" step 5/17 "Estructura .forge/" "YA EXISTE"
69
+
70
+ :step6
71
+ REM --- STEP 6/17: .gitignore ---
72
+ if exist ".gitignore" goto :step6_ok
73
+ call "%LIB%\templates.cmd" write_gitignore
74
+ call "%LIB%\ui.cmd" step 6/17 ".gitignore universal" "CREADO"
75
+ goto :step7
76
+ :step6_ok
77
+ call "%LIB%\ui.cmd" step 6/17 ".gitignore" "YA EXISTE"
78
+
79
+ :step7
80
+ REM --- STEP 7/17: README.md ---
81
+ if exist "README.md" goto :step7_ok
82
+ call "%LIB%\templates.cmd" write_readme
83
+ call "%LIB%\ui.cmd" step 7/17 "README.md adaptativo" "CREADO"
84
+ goto :step8
85
+ :step7_ok
86
+ call "%LIB%\ui.cmd" step 7/17 "README.md" "YA EXISTE"
87
+
88
+ :step8
89
+ REM --- STEP 8/17: forge.cmd ---
90
+ if exist "forge.cmd" goto :step8_ok
91
+ call "%LIB%\templates.cmd" write_forge
92
+ call "%LIB%\ui.cmd" step 8/17 "forge.cmd menu" "CREADO"
93
+ goto :step9
94
+ :step8_ok
95
+ call "%LIB%\ui.cmd" step 8/17 "forge.cmd" "YA EXISTE"
96
+
97
+ :step9
98
+ REM --- STEP 9/17: save.cmd ---
99
+ if exist ".forge\commands\save.cmd" goto :step9_ok
100
+ call "%LIB%\templates.cmd" write_save
101
+ call "%LIB%\ui.cmd" step 9/17 "save.cmd" "CREADO"
102
+ goto :step10
103
+ :step9_ok
104
+ call "%LIB%\ui.cmd" step 9/17 "save.cmd" "YA EXISTE"
105
+
106
+ :step10
107
+ REM --- STEP 10/17: push.cmd ---
108
+ if exist ".forge\commands\push.cmd" goto :step10_ok
109
+ call "%LIB%\templates.cmd" write_push
110
+ call "%LIB%\ui.cmd" step 10/17 "push.cmd" "CREADO"
111
+ goto :step11
112
+ :step10_ok
113
+ call "%LIB%\ui.cmd" step 10/17 "push.cmd" "YA EXISTE"
114
+
115
+ :step11
116
+ REM --- STEP 11/17: snapshots.cmd ---
117
+ if exist ".forge\commands\snapshots.cmd" goto :step11_ok
118
+ call "%LIB%\templates.cmd" write_snapshots
119
+ call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "CREADO"
120
+ goto :step12
121
+ :step11_ok
122
+ call "%LIB%\ui.cmd" step 11/17 "snapshots.cmd" "YA EXISTE"
123
+
124
+ :step12
125
+ REM --- STEP 12/17: historial.cmd ---
126
+ if exist ".forge\commands\historial.cmd" goto :step12_ok
127
+ call "%LIB%\templates.cmd" write_historial
128
+ call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "CREADO"
129
+ goto :step13
130
+ :step12_ok
131
+ call "%LIB%\ui.cmd" step 12/17 "historial.cmd" "YA EXISTE"
132
+
133
+ :step13
134
+ REM --- STEP 13/17: abrir.cmd ---
135
+ if exist ".forge\commands\abrir.cmd" goto :step13_ok
136
+ call "%LIB%\templates.cmd" write_abrir
137
+ call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "CREADO"
138
+ goto :step14
139
+ :step13_ok
140
+ call "%LIB%\ui.cmd" step 13/17 "abrir.cmd" "YA EXISTE"
141
+
142
+ :step14
143
+ REM --- STEP 14/17: auditar.cmd ---
144
+ if exist ".forge\commands\auditar.cmd" goto :step14_ok
145
+ call "%LIB%\templates.cmd" write_auditar
146
+ call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "CREADO"
147
+ goto :step15
148
+ :step14_ok
149
+ call "%LIB%\ui.cmd" step 14/17 "auditar.cmd" "YA EXISTE"
150
+
151
+ :step15
152
+ REM --- STEP 15/17: serve.cmd ---
153
+ if exist ".forge\commands\serve.cmd" goto :step15_ok
154
+ call "%LIB%\templates.cmd" write_serve
155
+ call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "CREADO"
156
+ goto :step16
157
+ :step15_ok
158
+ call "%LIB%\ui.cmd" step 15/17 "serve.cmd" "YA EXISTE"
159
+
160
+ :step16
161
+ REM --- STEP 16/17: Commit ---
162
+ call "%LIB%\git-ops.cmd" has_changes
163
+ if errorlevel 1 (
164
+ set "USER_MSG="
165
+ set /p "USER_MSG= Mensaje del commit [Enter = default]: "
166
+ if "!USER_MSG!"=="" set "USER_MSG=%COMMIT_MESSAGE%"
167
+ call "%LIB%\git-ops.cmd" commit "!USER_MSG!"
168
+ call "%LIB%\ui.cmd" step 16/17 "Commit: !USER_MSG!" "CREADO"
169
+ ) else (
170
+ call "%LIB%\ui.cmd" step 16/17 "Sin cambios para commit" "SKIP"
171
+ )
172
+
173
+ REM --- STEP 17/17: Tag ---
174
+ call "%LIB%\git-ops.cmd" tag
175
+ if errorlevel 1 (
176
+ call "%LIB%\ui.cmd" step 17/17 "Tag %TAG_INITIAL%" "CREADO"
177
+ ) else (
178
+ call "%LIB%\ui.cmd" step 17/17 "Tag %TAG_INITIAL%" "YA EXISTE"
179
+ )
180
+
181
+ call "%LIB%\ui.cmd" done
182
+ call :shell_if_double_click
183
+ endlocal
184
+ exit /b 0
185
+
186
+ :abort
187
+ call "%LIB%\ui.cmd" abort
188
+ call :shell_if_double_click
189
+ endlocal
190
+ exit /b 1
191
+
192
+ :shell_if_double_click
193
+ if "%NO_PAUSE%"=="1" goto :eof
194
+ echo %cmdcmdline% | find /i "%~nx0" >nul
195
+ if errorlevel 1 goto :eof
196
+ echo.
197
+ echo Sesion interactiva abierta. Escribe 'exit' para cerrar.
198
+ echo.
199
+ cmd /k
191
200
  goto :eof
package/lib/git-ops.cmd CHANGED
@@ -1,92 +1,92 @@
1
- @echo off
2
- REM ============================================================
3
- REM forge-git / lib/git-ops.cmd
4
- REM Git operations
5
- REM
6
- REM Usage:
7
- REM call "git-ops.cmd" init - init repo
8
- REM call "git-ops.cmd" branch_main - rename branch to main
9
- REM call "git-ops.cmd" has_changes - check for pending changes
10
- REM call "git-ops.cmd" commit "msg" - commit with message
11
- REM call "git-ops.cmd" tag - create tag
12
- REM
13
- REM Return codes:
14
- REM 0 = nothing to do (already exists / no changes)
15
- REM 1 = action performed
16
- REM ============================================================
17
-
18
- REM --- Detectar PROJECT_ROOT ---
19
- REM Si git-ops.cmd esta en .forge/lib/ -> PROJECT_ROOT = ..\..
20
- REM Si git-ops.cmd esta en lib/ -> PROJECT_ROOT = ..
21
- set "ROOT=%~dp0"
22
- REM Detectar si estamos dentro de .forge
23
- echo "%ROOT%" | find /i ".forge" >nul
24
- if not errorlevel 1 (
25
- set "PROJECT_ROOT=%ROOT%..\.."
26
- ) else (
27
- set "PROJECT_ROOT=%ROOT%.."
28
- )
29
-
30
- if "%~1"=="init" goto :init
31
- if "%~1"=="branch_main" goto :branch_main
32
- if "%~1"=="has_changes" goto :has_changes
33
- if "%~1"=="commit" goto :commit
34
- if "%~1"=="tag" goto :tag
35
- goto :eof
36
-
37
- :init
38
- pushd "%PROJECT_ROOT%"
39
- if exist ".git" (
40
- popd
41
- call "%~dp0ui.cmd" step 3/16 "Repositorio Git" "YA EXISTE"
42
- exit /b 0
43
- )
44
- git init -q
45
- if errorlevel 1 (
46
- popd
47
- call "%~dp0ui.cmd" step 3/16 "Repositorio Git" "ERROR"
48
- exit /b 1
49
- )
50
- popd
51
- call "%~dp0ui.cmd" step 3/16 "Repositorio Git" "CREADO"
52
- exit /b 1
53
-
54
- :branch_main
55
- pushd "%PROJECT_ROOT%"
56
- git branch -M %BRANCH_MAIN% >nul 2>nul
57
- popd
58
- call "%~dp0ui.cmd" step 4/16 "Rama principal: %BRANCH_MAIN%" "OK"
59
- exit /b 0
60
-
61
- :has_changes
62
- pushd "%PROJECT_ROOT%"
63
- git add -A >nul 2>nul
64
- git diff --cached --quiet
65
- set "RC=%ERRORLEVEL%"
66
- popd
67
- if %RC% NEQ 0 ( exit /b 1 ) else ( exit /b 0 )
68
-
69
- :commit
70
- set "MSG=%~2"
71
- if "!MSG!"=="" set "MSG=%COMMIT_MESSAGE%"
72
- pushd "%PROJECT_ROOT%"
73
- git commit -q -m "!MSG!"
74
- set "RC=%ERRORLEVEL%"
75
- popd
76
- if %RC% NEQ 0 ( exit /b 0 ) else ( exit /b 1 )
77
-
78
- :tag
79
- pushd "%PROJECT_ROOT%"
80
- git rev-parse %TAG_INITIAL% >nul 2>nul
81
- if not errorlevel 1 (
82
- popd
83
- exit /b 0
84
- )
85
- git rev-parse HEAD >nul 2>nul
86
- if errorlevel 1 (
87
- popd
88
- exit /b 0
89
- )
90
- git tag -a %TAG_INITIAL% -m "%TAG_MESSAGE%" 2>nul
91
- popd
1
+ @echo off
2
+ REM ============================================================
3
+ REM forge-git / lib/git-ops.cmd
4
+ REM Git operations
5
+ REM
6
+ REM Usage:
7
+ REM call "git-ops.cmd" init - init repo
8
+ REM call "git-ops.cmd" branch_main - rename branch to main
9
+ REM call "git-ops.cmd" has_changes - check for pending changes
10
+ REM call "git-ops.cmd" commit "msg" - commit with message
11
+ REM call "git-ops.cmd" tag - create tag
12
+ REM
13
+ REM Return codes:
14
+ REM 0 = nothing to do (already exists / no changes)
15
+ REM 1 = action performed
16
+ REM ============================================================
17
+
18
+ REM --- Detectar PROJECT_ROOT ---
19
+ REM Si git-ops.cmd esta en .forge/lib/ -> PROJECT_ROOT = ..\..
20
+ REM Si git-ops.cmd esta en lib/ -> PROJECT_ROOT = ..
21
+ set "ROOT=%~dp0"
22
+ REM Detectar si estamos dentro de .forge
23
+ echo "%ROOT%" | find /i ".forge" >nul
24
+ if not errorlevel 1 (
25
+ set "PROJECT_ROOT=%ROOT%..\.."
26
+ ) else (
27
+ set "PROJECT_ROOT=%ROOT%.."
28
+ )
29
+
30
+ if "%~1"=="init" goto :init
31
+ if "%~1"=="branch_main" goto :branch_main
32
+ if "%~1"=="has_changes" goto :has_changes
33
+ if "%~1"=="commit" goto :commit
34
+ if "%~1"=="tag" goto :tag
35
+ goto :eof
36
+
37
+ :init
38
+ pushd "%PROJECT_ROOT%"
39
+ if exist ".git" (
40
+ popd
41
+ call "%~dp0ui.cmd" step 3/17 "Repositorio Git" "YA EXISTE"
42
+ exit /b 0
43
+ )
44
+ git init -q
45
+ if errorlevel 1 (
46
+ popd
47
+ call "%~dp0ui.cmd" step 3/17 "Repositorio Git" "ERROR"
48
+ exit /b 1
49
+ )
50
+ popd
51
+ call "%~dp0ui.cmd" step 3/17 "Repositorio Git" "CREADO"
52
+ exit /b 1
53
+
54
+ :branch_main
55
+ pushd "%PROJECT_ROOT%"
56
+ git branch -M %BRANCH_MAIN% >nul 2>nul
57
+ popd
58
+ call "%~dp0ui.cmd" step 4/17 "Rama principal: %BRANCH_MAIN%" "OK"
59
+ exit /b 0
60
+
61
+ :has_changes
62
+ pushd "%PROJECT_ROOT%"
63
+ git add -A >nul 2>nul
64
+ git diff --cached --quiet
65
+ set "RC=%ERRORLEVEL%"
66
+ popd
67
+ if %RC% NEQ 0 ( exit /b 1 ) else ( exit /b 0 )
68
+
69
+ :commit
70
+ set "MSG=%~2"
71
+ if "!MSG!"=="" set "MSG=%COMMIT_MESSAGE%"
72
+ pushd "%PROJECT_ROOT%"
73
+ git commit -q -m "!MSG!"
74
+ set "RC=%ERRORLEVEL%"
75
+ popd
76
+ if %RC% NEQ 0 ( exit /b 0 ) else ( exit /b 1 )
77
+
78
+ :tag
79
+ pushd "%PROJECT_ROOT%"
80
+ git rev-parse %TAG_INITIAL% >nul 2>nul
81
+ if not errorlevel 1 (
82
+ popd
83
+ exit /b 0
84
+ )
85
+ git rev-parse HEAD >nul 2>nul
86
+ if errorlevel 1 (
87
+ popd
88
+ exit /b 0
89
+ )
90
+ git tag -a %TAG_INITIAL% -m "%TAG_MESSAGE%" 2>nul
91
+ popd
92
92
  exit /b 1