/
2ftp-configurar.bat
149 lines (99 loc) · 3.62 KB
/
2ftp-configurar.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
@echo off
setlocal
set /p ftpServidor=<_jugodegrunt\ftpServidor.txt
set /p ftpPuerto=<_jugodegrunt\ftpPuerto.txt
set /p ftpUsuario=<_jugodegrunt\ftpUsuario.txt
set /p ftpPassword=<_jugodegrunt\ftpPassword.txt
set /p ftpDirectorioDestino=<_jugodegrunt\ftpDirectorioDestino.txt
set /p ftpAsubir=<_jugodegrunt\ftpAsubir.txt
echo Se configurar la conexi¢n al servidor FTP a donde realizar subidas, se pedir direcci¢n del servidor, puerto a utilizar (habitualmente 21), usuario y contrase¤a, directorio donde se subir (por ejemplo '/public_html'), y aquello que se subir (Desarrollo o Producci¢n).
echo.
set /p temp_ftpServidor=¨Direcci¢n del Servidor [%ftpServidor%]?
if "%temp_ftpServidor%"=="" (
if "%ftpServidor%"=="mipaginaweb.es" (
echo La direcci¢n del servidor queda sin configurar mipaginaweb.es es un ejemplo.
echo Puedes introducir el resto de los datos si lo deseas...
)
) else (
del .grunt\grunt-ftp-diff-deployer\*.* /F /Q
)
:PREGUNTAS
set /p temp_ftpPuerto=¨Puerto [%ftpPuerto%]?
set /p temp_ftpUsuario=¨Usuario de acceso [%ftpUsuario%]?
set /p temp_ftpPassword=¨Password de acceso [%ftpPassword%]?
set /p temp_ftpDirectorioDestino=¨Directorio de destino [%ftpDirectorioDestino%]?
:PREGUNTAFTPASUBIR
if "%ftpAsubir%"=="pr" (
goto PREGUNTAPR
) else if "%ftpAsubir%"=="de" (
goto PREGUNTADE
)
:PREGUNTAPR
set /p temp_ftpAsubir=¨Que directorio se subir , Desarrollo o Producci¢n (de/[pr])?
if "%temp_ftpAsubir%"=="" (
echo %ftpAsubir%>_jugodegrunt\ftpAsubir.txt
echo {"ftpAsubir":"%ftpAsubir%"}>_jugodegrunt\ftpAsubir.json
) else (
echo %temp_ftpAsubir%>_jugodegrunt/ftpAsubir.txt
echo {"ftpAsubir":"%temp_ftpAsubir%"}>_jugodegrunt/ftpAsubir.json
)
goto CONTINUA
:PREGUNTADE
set /p temp_ftpAsubir=¨Que directorio se subir , Producci¢n o Desarrolo (pr/[de])?
if "%temp_ftpAsubir%"=="" (
echo %ftpAsubir%>_jugodegrunt/ftpAsubir.txt
echo {"ftpAsubir":"%ftpAsubir%"}>_jugodegrunt/ftpAsubir.json
) else (
echo %temp_ftpAsubir%>_jugodegrunt/ftpAsubir.txt
echo {"ftpAsubir":"%temp_ftpAsubir%"}>_jugodegrunt/ftpAsubir.json
)
goto CONTINUA
:CONTINUA
if "%temp_ftpServidor%"=="" (
echo %ftpServidor%>_jugodegrunt/ftpServidor.txt
echo {"ftpServidor":"%ftpServidor%"}>_jugodegrunt/ftpServidor.json
) else (
echo %temp_ftpServidor%>_jugodegrunt/ftpServidor.txt
echo {"ftpServidor":"%temp_ftpServidor%"}>_jugodegrunt/ftpServidor.json
)
if "%temp_ftpPuerto%"=="" (
echo %ftpPuerto%>_jugodegrunt/ftpPuerto.txt
echo {"ftpPuerto":"%ftpPuerto%"}>_jugodegrunt/ftpPuerto.json
) else (
echo %temp_ftpPuerto%>_jugodegrunt/ftpPuerto.txt
echo {"ftpPuerto":"%temp_ftpPuerto%"}>_jugodegrunt/ftpPuerto.json
)
if "%temp_ftpUsuario%"=="" (
goto USUARIOANTERIOR
) else (
goto SETPASS
)
:USUARIOANTERIOR
set temp_ftpUsuario=%ftpUsuario%
goto SETPASS
:SETPASS
if "%temp_ftpPassword%"=="" (
goto PASSWORDANTERIOR
) else (
goto ESCRIBIRUSERPASS
)
:PASSWORDANTERIOR
set temp_ftpPassword=%ftpPassword%
goto ESCRIBIRUSERPASS
:ESCRIBIRUSERPASS
echo %temp_ftpUsuario%>_jugodegrunt/ftpUsuario.txt
echo {"ftpUsuario":"%temp_ftpUsuario%"}>_jugodegrunt/ftpUsuario.json
echo %temp_ftpPassword%>_jugodegrunt/ftpPassword.txt
echo {"ftpPassword":"%temp_ftpPassword%"}>_jugodegrunt/ftpPassword.json
if "%temp_ftpDirectorioDestino%"=="" (
echo %ftpDirectorioDestino%>_jugodegrunt/ftpDirectorioDestino.txt
echo {"ftpDirectorioDestino":"%ftpDirectorioDestino%"}>_jugodegrunt/ftpDirectorioDestino.json
) else (
del .grunt\grunt-ftp-diff-deployer\*.* /F /Q
echo %temp_ftpDirectorioDestino%>_jugodegrunt/ftpDirectorioDestino.txt
echo {"ftpDirectorioDestino":"%temp_ftpDirectorioDestino%"}>_jugodegrunt/ftpDirectorioDestino.json
)
echo.
pause
:END
endlocal