|
@@ -140,6 +140,7 @@ func main() {
|
|
|
}
|
|
|
|
|
|
obsUrl := checkFile
|
|
|
+ size, _ := strconv.Atoi(strings.Replace(appConf.Size, "MB", "", -1))
|
|
|
if isCover {
|
|
|
// 上传文件
|
|
|
huawei.InitConfig()
|
|
@@ -156,6 +157,8 @@ func main() {
|
|
|
return
|
|
|
}
|
|
|
fmt.Println("succ uploaded=>", obs.Url)
|
|
|
+ fmt.Println(obs.Size)
|
|
|
+ size = int(obs.Size / (1024 * 1024))
|
|
|
obsUrl = fmt.Sprintf("https:%s", obs.Url)
|
|
|
|
|
|
}
|
|
@@ -163,11 +166,11 @@ func main() {
|
|
|
// 获取最新版本
|
|
|
// 输出db文件
|
|
|
outputDb := "output/db.json"
|
|
|
- sizeM, err := strconv.Atoi(strings.Replace(appConf.Size, "MB", "", -1))
|
|
|
- if err != nil {
|
|
|
- fmt.Println("转换size string->int 错误:", err)
|
|
|
+ // sizeM, err := strconv.Atoi(strings.Replace(appConf.Size, "MB", "", -1))
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("转换size string->int 错误:", err)
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
// obsUrl := fmt.Sprintf("https:%s", obs.Url)
|
|
|
|
|
|
fmt.Println("上传成功")
|
|
@@ -203,7 +206,7 @@ func main() {
|
|
|
fmt.Println(appVersion)
|
|
|
// 调用接口修改配置
|
|
|
appVersion.Version = version
|
|
|
- appVersion.SizeM = float32(sizeM)
|
|
|
+ appVersion.SizeM = float32(size)
|
|
|
appVersion.Url = obsUrl
|
|
|
data, err := json.Marshal(appVersion)
|
|
|
if err != nil {
|
|
@@ -228,7 +231,7 @@ func main() {
|
|
|
Icon: appVersion.Icon,
|
|
|
Type: appVersion.Type,
|
|
|
Version: version,
|
|
|
- SizeM: sizeM,
|
|
|
+ SizeM: size,
|
|
|
Url: obsUrl,
|
|
|
Platform: appVersion.Platform,
|
|
|
Thumbnail: appVersion.Thumbnail,
|