测试版本库,随便折腾。
陈炜
2024-12-23 c52062234bdaf9d463d8d583c1984a227c2c974d
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
@echo off
 
set "a=%~dp0"
rem echo %a%
set a=%a:\=\\%
rem echo %a%
set b="%a%Mixly.exe"
rem echo %b%
wmic process where 'executablepath=%b%' call Terminate > nul
 
"%~dp0\Git\cmd\git" config --global --add safe.directory "%~dp0"
"%~dp0\Git\cmd\git" config --system core.longpaths true
 
rem É¾³ý.git_win_stm32Îļþ¼Ð
if exist "%~dp0\.git_win_stm32" (
    attrib -h "%~dp0\.git_win_stm32"
    del /f /s /q "%~dp0\.git_win_stm32" > nul
    rd /q /s "%~dp0\.git_win_stm32" > nul
)
 
rem Åжϵ±Ç°Ä¿Â¼ÏÂÊÇ·ñÓÐ.gitĿ¼£¬Èç¹ûÓÐÔòÊ×ÏȽ«.gitĿ¼ֻ¶ÁÊôÐÔÈ¥³ý£¬²¢½«ÆäÖØÃüÃû
if exist "%~dp0"\.git (
    attrib -h "%~dp0\.git"
    attrib -h "%~dp0\.git_mixly"
    attrib -h "%~dp0\.git_win_avr"
    attrib -h "%~dp0\.git_win_esp8266"
    attrib -h "%~dp0\.git_win_esp32"
    attrib -h "%~dp0\.git_arduino_libs"
    if not exist "%~dp0\.git_mixly" (
        ren "%~dp0\.git\" .git_mixly
        attrib +h "%~dp0\.git_mixly"
    ) ELSE IF not exist "%~dp0\.git_win_avr" (
        ren "%~dp0\.git\" .git_win_avr
        attrib +h "%~dp0\.git_win_avr"
    ) ELSE IF not exist "%~dp0\.git_win_esp8266" (
        ren "%~dp0\.git\" .git_win_esp8266
        attrib +h "%~dp0\.git_win_esp8266"
    ) ELSE IF not exist "%~dp0\.git_win_esp32" (
        ren "%~dp0\.git\" .git_win_esp32
        attrib +h "%~dp0\.git_win_esp32"
    ) ELSE IF not exist "%~dp0\.git_arduino_libs" (
        ren "%~dp0\.git\" .git_arduino_libs
        attrib +h "%~dp0\.git_arduino_libs"
    ) ELSE (
        del /f /s /q "%~dp0"\.git > nul
        rd /q /s "%~dp0"\.git > nul
    )
)
 
rem É¾³ý.gitĿ¼ÏÂindex.lock
IF EXIST "%~dp0\.git_mixly\index.lock" ( 
    del /f /s /q "%~dp0\.git_mixly\index.lock" > nul
    rd /q /s "%~dp0\.git_mixly\index.lock" > nul
)
 
IF EXIST "%~dp0\.git_win_avr\index.lock" ( 
    del /f /s /q "%~dp0\.git_win_avr\index.lock" > nul
    rd /q /s "%~dp0\.git_win_avr\index.lock" > nul
)
 
IF EXIST "%~dp0\.git_win_esp8266\index.lock" ( 
    del /f /s /q "%~dp0\.git_win_esp8266\index.lock" > nul
    rd /q /s "%~dp0\.git_win_esp8266\index.lock" > nul
)
 
IF EXIST "%~dp0\.git_win_esp32\index.lock" ( 
    del /f /s /q "%~dp0\.git_win_esp32\index.lock" > nul
    rd /q /s "%~dp0\.git_win_esp32\index.lock" > nul
)
 
echo µ±Ç°Â·¾¶Îª"%~dp0"
 
@echo off
title Mixly2.0 °²×°^&Éý¼¶ÖúÊÖ
@echo off
echo. 
echo ***************************Mixly2.0 °²×°^&Éý¼¶ÖúÊÖ****************************
echo ¸ÐлÄúÑ¡ÔñʹÓÃMixly2.0Èí¼þ£¬Èç¹ûÄúÊǵÚÒ»´ÎʹÓñ¾Èí¼þ£¬Çë×ÐϸÔĶÁ±¾ËµÃ÷¡£
echo.
echo.
echo Ä¿Ç°Mixly2.0Èí¼þÖ§³Ö¶Ô¶àÖÖÓ²¼þµÄ±à³Ì£¬ÒòΪ֧³ÖËùÓÐÓ²¼þ±à³ÌÐèÒªÕ¼ÓÃÄúÓ²Å̽ϴóµÄ¿Õ¼ä£¬Äú¿ÉÒÔÑ¡ÔñÖ»°²×°ÄúÐèÒªÓõ½µÄ²¿·Ö¹¦Äܼ´¿É¡£
echo.
echo Mixly2.0Èí¼þÖ§³ÖµÄÓ²¼þ£¬¾ßÌå˵Ã÷ÈçÏ£º
echo ¡¤MicroPython/CircuitPython ESP32ϵÁпª·¢°å(MicroPython[ESP32_MixGo]¡¢CircuitPython[ESP32S2_MixGoCE]µÈ)ΪĬÈÏÖ§³Ö£¬ÎÞÐèÑ¡Ôñ¡£
echo ¡¤Python(´¿Python,ÎÞÐèÓ²¼þ£¬Ö§³ÖͼÐλ¯ºÍ´úÂ뻥Ïàת»»)ΪĬÈÏÖ§³Ö£¬ÎÞÐèÑ¡Ôñ¡£
echo ¡¤Arduino AVRϵÁпª·¢°å£¨°üÀ¨Arduino UNO,Nano,Mega 2560,Pro Mini µÈ£©
echo ¡¤Arduino ESP8266ϵÁпª·¢°å£¨°üÀ¨WeMos D1,NodeMCU µÈ£©
echo ¡¤Arduino ESP32ϵÁпª·¢°å£¨°üÀ¨MixGo,ÆÕͨESP32¿ª·¢°åµÈ£©
echo.
echo.
echo °²×°^&Éý¼¶¼´½«¿ªÊ¼£¬Äú¿ÉÒÔÑ¡Ôñ°²×°²¿·Ö¹¦ÄÜ£¬ÊäÈëy±íʾ°²×°¸Ã¹¦ÄÜ£¬ÊäÈën±íʾ²»°²×°¸Ã¹¦ÄÜ¡£
@echo off
 
rem Ñ¯ÎÊÓû§ÊÇ·ñ°²×°Arduino ESP8266
echo.
set esp8266_select=
set /p esp8266_select=°²×° Arduino ESP8266(y/n):
IF "%esp8266_select%"=="n" (
    echo No
) ELSE (
    echo Yes
)
 
rem Ñ¯ÎÊÓû§ÊÇ·ñ°²×°Arduino ESP32
echo.
set esp32_select=
set /p esp32_select=°²×° Arduino ESP32(y/n):
IF "%esp32_select%"=="n" (
    echo No
) ELSE (
    echo Yes
)
 
rem Ñ¯ÎÊÓû§¸üкóÊÇ·ñÆô¶¯Mixly
echo.
set start_mixly=
set /p start_mixly=¸üнáÊøºóÆô¶¯ Mixly2.0(y/n):
IF "%start_mixly%"=="y" (
    echo Yes
) ELSE (
    echo No
)
 
rem ¸üÐÂMixly2.0
attrib -h "%~dp0\.git_mixly"
ren "%~dp0\.git_mixly\" .git
 
@echo on
echo Mixly2.0 ÕýÔÚÉý¼¶ÖУ¬ÇëµÈ´ý...
@echo off
cd "%~dp0\Git\cmd\"
git fetch --all
git reset --hard origin/master
git pull origin master
git submodule init
git submodule update
git submodule foreach "git fetch --all && git reset --hard origin/master && git pull origin master"
@echo off
rd/s/q "%~dp0\.git\logs\"
git gc
git prune
git clean -f .git/index.lock
@echo on
echo Mixly2.0¸üÐÂÍê³É
@echo off
 
ren "%~dp0\.git\" .git_mixly
attrib +h "%~dp0\.git_mixly"
 
echo.
echo.
 
rem ¸üÐÂArduino AVR °ü
attrib -h "%~dp0\.git_win_avr"
ren "%~dp0\.git_win_avr\" .git
 
@echo on
echo Arduino AVR °üÕýÔÚÉý¼¶ÖУ¬ÇëµÈ´ý...
@echo off
cd "%~dp0\Git\cmd\"
git fetch --all
git reset --hard origin/master
git pull origin master
 
@echo off
rd/s/q "%~dp0\.git\logs\"
git gc
git prune
git clean -f .git/index.lock
@echo on
echo Arduino AVR °ü¸üÐÂÍê³É
@echo off
 
ren "%~dp0\.git\" .git_win_avr
attrib +h "%~dp0\.git_win_avr"
 
echo.
echo.
 
IF not exist "%~dp0\.git_arduino_libs" (
    @echo on
    echo ¿Ë¡ Arduino Libs °üÖУ¬ÇëµÈ´ý...
    @echo off
    IF EXIST "%~dp0\arduino-cli\libraries" (
        del /f /s /q "%~dp0\arduino-cli\libraries" > nul
        rd /q /s "%~dp0\arduino-cli\libraries" > nul
    )
    IF EXIST "%~dp0\gitDir" (
        del /f /s /q "%~dp0\gitDir" > nul
        rd /q /s "%~dp0\gitDir" > nul
    )
    mkdir "%~dp0\gitDir"
    git clone https://gitee.com/mixly2/arduino-libs.git "%~dp0\gitDir"
    attrib -h "%~dp0\gitDir\.git"
    ren "%~dp0\gitDir\.git" .git_arduino_libs
    echo A|xcopy "%~dp0\gitDir\.git_arduino_libs" "%~dp0\.git_arduino_libs\" /s /c /h > nul
    
    attrib +h "%~dp0\.git_arduino_libs"
    
    IF EXIST "%~dp0\gitDir" (
        del /f /s /q "%~dp0\gitDir" > nul
        rd /q /s "%~dp0\gitDir" > nul
    )
    @echo on
    echo Arduino Libs ¿Ë¡Íê³É
    @echo off
    echo.
    echo.
)
 
IF EXIST "%~dp0\.git_arduino_libs" (
    rem ¸üÐÂArduino-libs
    attrib -h "%~dp0\.git_arduino_libs"
    ren "%~dp0\.git_arduino_libs\" .git
 
    @echo on
    echo Arduino Libs °üÕýÔÚÉý¼¶ÖУ¬ÇëµÈ´ý...
    @echo off
    cd "%~dp0\Git\cmd\"
    git fetch --all
    git reset --hard origin/master
    git pull origin master
 
    @echo off
    rd/s/q "%~dp0\.git\logs\"
    git gc
    git prune
    git clean -f .git/index.lock
    @echo on
    echo Arduino Libs °ü¸üÐÂÍê³É
    @echo off
 
    ren "%~dp0\.git\" .git_arduino_libs
    attrib +h "%~dp0\.git_arduino_libs"
 
    echo.
    echo.
)
 
IF "%esp8266_select%"=="n" (
    rem É¾³ýArduino ESP8266°ü
    IF EXIST "%~dp0\arduino-cli\Arduino15\packages\esp8266" (
        del /f /s /q "%~dp0\arduino-cli\Arduino15\packages\esp8266" > nul
        rd /q /s "%~dp0\arduino-cli\Arduino15\packages\esp8266" > nul
    )
    rem É¾³ýArduino ESP8266°å¿¨Ò³Ãæ
    IF EXIST "%~dp0\resources\app\board\arduino_esp8266" (
        del /f /s /q "%~dp0\resources\app\board\arduino_esp8266" > nul
        rd /q /s "%~dp0\resources\app\board\arduino_esp8266" > nul
    )
    attrib -h "%~dp0\.git_win_esp8266"
    rem É¾³ýArduino ESP8266 .git\objects
    IF EXIST "%~dp0\.git_win_esp8266\objects" (
        del /f /s /q "%~dp0\.git_win_esp8266\objects" > nul
        rd /q /s "%~dp0\.git_win_esp8266\objects" > nul
    )
    rem É¾³ýArduino ESP8266 .git\refs
    IF EXIST "%~dp0\.git_win_esp8266\refs" (
        del /f /s /q "%~dp0\.git_win_esp8266\refs" > nul
        rd /q /s "%~dp0\.git_win_esp8266\refs" > nul
    )
    md "%~dp0\.git_win_esp8266\objects" > nul
    md "%~dp0\.git_win_esp8266\objects\info" > nul
    md "%~dp0\.git_win_esp8266\objects\pack" > nul
    md "%~dp0\.git_win_esp8266\refs" > nul
    md "%~dp0\.git_win_esp8266\refs\heads" > nul
    md "%~dp0\.git_win_esp8266\refs\tags" > nul
    IF EXIST "%~dp0\.git_win_esp8266\index" (
        del "%~dp0\.git_win_esp8266\index" > nul
    )
    IF EXIST "%~dp0\.git_win_esp8266\ORIG_HEAD" (
        del "%~dp0\.git_win_esp8266\ORIG_HEAD" > nul
    )
    IF EXIST "%~dp0\.git_win_esp8266\packed-refs" (
        del "%~dp0\.git_win_esp8266\packed-refs" > nul
    )
    attrib +h "%~dp0\.git_win_esp8266"
) ELSE (
    rem ¸üÐÂArduino ESP8266 °ü
    attrib -h "%~dp0\.git_win_esp8266"
    ren "%~dp0\.git_win_esp8266\" .git
 
    @echo on
    echo Arduino ESP8266 °üÕýÔÚÉý¼¶ÖУ¬ÇëµÈ´ý...
    @echo off
    cd "%~dp0\Git\cmd\"
    git fetch --all
    git reset --hard origin/master
    git pull origin master
 
    @echo off
    rd/s/q "%~dp0\.git\logs\"
    git gc
    git prune
    git clean -f .git/index.lock
    @echo on
    echo Arduino ESP8266 °ü¸üÐÂÍê³É
    @echo off
 
    ren "%~dp0\.git\" .git_win_esp8266
    attrib +h "%~dp0\.git_win_esp8266"
    
    echo.
    echo.
)
 
IF "%esp32_select%"=="n" (
    rem É¾³ýArduino ESP32°ü
    IF EXIST "%~dp0\arduino-cli\Arduino15\packages\esp32" (
        del /f /s /q "%~dp0\arduino-cli\Arduino15\packages\esp32" > nul
        rd /q /s "%~dp0\arduino-cli\Arduino15\packages\esp32" > nul
    )
    rem É¾³ýArduino ESP32°å¿¨Ò³Ãæ
    IF EXIST "%~dp0\resources\app\board\arduino_esp32" (
        del /f /s /q "%~dp0\resources\app\board\arduino_esp32" > nul
        rd /q /s "%~dp0\resources\app\board\arduino_esp32" > nul
    )
    rem É¾³ýArduino ESP32C3°å¿¨Ò³Ãæ
    IF EXIST "%~dp0\resources\app\board\arduino_esp32c3" (
        del /f /s /q "%~dp0\resources\app\board\arduino_esp32c3" > nul
        rd /q /s "%~dp0\resources\app\board\arduino_esp32c3" > nul
    )
    rem É¾³ýArduino ESP32S2°å¿¨Ò³Ãæ
    IF EXIST "%~dp0\resources\app\board\arduino_esp32s2" (
        del /f /s /q "%~dp0\resources\app\board\arduino_esp32s2" > nul
        rd /q /s "%~dp0\resources\app\board\arduino_esp32s2" > nul
    )
    rem É¾³ýArduino ESP32S3°å¿¨Ò³Ãæ
    IF EXIST "%~dp0\resources\app\board\arduino_esp32s3" (
        del /f /s /q "%~dp0\resources\app\board\arduino_esp32s3" > nul
        rd /q /s "%~dp0\resources\app\board\arduino_esp32s3" > nul
    )
    attrib -h "%~dp0\.git_win_esp32"
    rem É¾³ýArduino ESP32 .git\objects
    IF EXIST "%~dp0\.git_win_esp32\objects" (
        del /f /s /q "%~dp0\.git_win_esp32\objects" > nul
        rd /q /s "%~dp0\.git_win_esp32\objects" > nul
    )
    rem É¾³ýArduino ESP32 .git\refs
    IF EXIST "%~dp0\.git_win_esp32\refs" (
        del /f /s /q "%~dp0\.git_win_esp32\refs" > nul
        rd /q /s "%~dp0\.git_win_esp32\refs" > nul
    )
    md "%~dp0\.git_win_esp32\objects" > nul
    md "%~dp0\.git_win_esp32\objects\info" > nul
    md "%~dp0\.git_win_esp32\objects\pack" > nul
    md "%~dp0\.git_win_esp32\refs" > nul
    md "%~dp0\.git_win_esp32\refs\heads" > nul
    md "%~dp0\.git_win_esp32\refs\tags" > nul
    IF EXIST "%~dp0\.git_win_esp32\index" (
        del "%~dp0\.git_win_esp32\index" > nul
    )
    IF EXIST "%~dp0\.git_win_esp32\ORIG_HEAD" (
        del "%~dp0\.git_win_esp32\ORIG_HEAD" > nul
    )
    IF EXIST "%~dp0\.git_win_esp32\packed-refs" (
        del "%~dp0\.git_win_esp32\packed-refs" > nul
    )
    attrib +h "%~dp0\.git_win_esp32"
) ELSE (
    rem ¸üÐÂArduino ESP32 °ü
    attrib -h "%~dp0\.git_win_esp32"
    ren "%~dp0\.git_win_esp32\" .git
 
    @echo on
    echo Arduino ESP32 °üÕýÔÚÉý¼¶ÖУ¬ÇëµÈ´ý...
    @echo off
    cd "%~dp0\Git\cmd\"
    git fetch --all
    git reset --hard origin/master
    git pull origin master
 
    @echo off
    rd/s/q "%~dp0\.git\logs\"
    git gc
    git prune
    git clean -f .git/index.lock
    @echo on
    echo Arduino ESP32 °ü¸üÐÂÍê³É
    @echo off
 
    ren "%~dp0\.git\" .git_win_esp32
    attrib +h "%~dp0\.git_win_esp32"
    
    echo.
    echo.
)
 
@echo on
echo Mixly2.0 ºÍ Arduino °ü¸üÐÂÍê³É£¬Enjoy it!
@echo off
pause
 
IF "%start_mixly%"=="y" (
    cd "%~dp0\"
    start "dummyclient" "%~dp0\Mixly.exe"
)