forgegit 1.4.0 → 1.5.0
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/.forge/commands/.gitkeep +0 -0
- package/.forge/commands/abrir.cmd +51 -0
- package/.forge/commands/auditar.cmd +340 -0
- package/.forge/commands/historial.cmd +85 -0
- package/.forge/commands/push.cmd +97 -0
- package/.forge/commands/save.cmd +73 -0
- package/{config.cmd → .forge/config.cmd} +1 -1
- package/.forge/init.cmd +173 -0
- package/.forge/lib/.gitkeep +0 -0
- package/.forge/templates/.gitkeep +0 -0
- package/.forge/templates/serve-static.js +86 -0
- package/.forge/templates/serve.cmd.tpl +209 -0
- package/.forge/templates/snapshots.cmd.tpl +329 -0
- package/forge.cmd +120 -0
- package/package.json +29 -36
- package/init.cmd +0 -200
- /package/{templates/serve.cmd.tpl → .forge/commands/serve.cmd} +0 -0
- /package/{templates/snapshots.cmd.tpl → .forge/commands/snapshots.cmd} +0 -0
- /package/{lib → .forge/lib}/git-ops.cmd +0 -0
- /package/{lib → .forge/lib}/templates.cmd +0 -0
- /package/{lib → .forge/lib}/ui.cmd +0 -0
- /package/{templates → .forge}/serve-static.js +0 -0
- /package/{templates → .forge/templates}/abrir.cmd.tpl +0 -0
- /package/{templates → .forge/templates}/auditar.cmd.tpl +0 -0
- /package/{templates → .forge/templates}/forge.cmd.tpl +0 -0
- /package/{templates → .forge/templates}/gitignore.tpl +0 -0
- /package/{templates → .forge/templates}/historial.cmd.tpl +0 -0
- /package/{templates → .forge/templates}/push.cmd.tpl +0 -0
- /package/{templates → .forge/templates}/readme.md.tpl +0 -0
- /package/{templates → .forge/templates}/save.cmd.tpl +0 -0
package/init.cmd
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
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
|
|
200
|
-
goto :eof
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|