forked from boyan01/flutter-netease-music
-
Notifications
You must be signed in to change notification settings - Fork 1
/
w.bat
54 lines (35 loc) · 1.08 KB
/
w.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
@echo off
setlocal enabledelayedexpansion
@REM 替换版本更新信息
set file=version.json
set file_tmp=version.json.tmp
set version=%1
set out_file=quiet/quiet-windows-v%1.zip
set isWindows=false
for /f "delims=" %%i in (%file%) do (
set str=%%i
echo !str! | findstr /C:"windows" >nul && (
set isWindows=true
)
echo !isWindows! | findstr /C:"true" >nul && (
@REM 判断是否是version
echo !str! | findstr /C:"version" >nul && (
echo "version": "%version%", >>%file_tmp%
) || (
@REM 判断是否是file
echo !str! | findstr /C:"file" >nul && (
set isWindows=false
echo "file": "%out_file%" >>%file_tmp%
) || (
echo !str!>>%file_tmp%
)
)
) || (
echo !str!>>%file_tmp%
)
)
move %file_tmp% %file%
@REM 替换打包前的版本信息
chcp 65001
@REM 开始构建
flutter build windows