Skip to content

Commit e1d25a2

Browse files
committed
Add -upload
1 parent de32ec5 commit e1d25a2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tool/rawstr4c/make-distribution.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
# Last Modified : <2025-07-21>
88
#
99
# Make rawstr4c distribution file (tar.gz)
10+
#
11+
# Usage:
12+
#
13+
# .\make-distribution.ps1 [-upload]
1014
# ---------------------------------------------------------------
1115

16+
param(
17+
[switch]$upload
18+
)
19+
1220
$files = @()
1321

1422
# 获取相对路径的函数
@@ -38,3 +46,18 @@ $archiveName = "rawstr4c-$(Get-Date -Format 'yyyyMMdd').tar.gz"
3846
$files | tar -czf $archiveName -T -
3947

4048
Write-Host "打包完成: $archiveName" -ForegroundColor Green
49+
Write-Host "提示: 可指定 -upload 直接上传" -ForegroundColor Green
50+
51+
# 如果指定了 upload 参数,则上传到 fez
52+
if ($upload) {
53+
Write-Host "正在上传到 fez..." -ForegroundColor Yellow
54+
55+
try {
56+
fez upload --file $archiveName
57+
Write-Host "上传成功!" -ForegroundColor Green
58+
} catch {
59+
Write-Error "上传失败: $_"
60+
exit 1
61+
}
62+
}
63+

0 commit comments

Comments
 (0)