Skip to content

Commit 7041303

Browse files
committed
Description Optional
1 parent bb1fe36 commit 7041303

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,5 @@ chmod +x code-push-go
120120
<string moduleConfig="true" name="CodePushServerUrl">${CODE_PUSH_SERVER_URL}</string>
121121
```
122122

123-
## Developing
124-
- [X] Delete app
125-
- [X] Delete deployment
126-
- [ ] Rollback bundel
127-
128123
## License
129124
MIT License [Read](https://github.com/htdcx/code-push-server-go/blob/main/LICENSE)

request/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func (App) Rollback(ctx *gin.Context) {
453453
log.Panic("Version not found")
454454
}
455455
if deploymentVersion.CurrentPackage == nil {
456-
log.Panic("Package is last")
456+
log.Panic("There is no upload package for the current version")
457457
}
458458
newPackage := model.Package{}.GetRollbackPack(*deployment.Id, *deploymentVersion.CurrentPackage, *deploymentVersion.Id)
459459

request/client.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
type Client struct{}
1717
type updateInfo struct {
18-
DownloadUrl string `json:"download_url"`
18+
DownloadUrl string `json:"download_url"`
1919
Description string `json:"description"`
2020
IsAvailable bool `json:"is_available"`
2121
IsDisabled bool `json:"is_disabled"`
@@ -51,18 +51,22 @@ func (Client) CheckUpdate(ctx *gin.Context) {
5151
}
5252
deploymentVersion := model.DeploymentVersion{}.GetByKeyDeploymentIdAndVersion(*deployment.Id, appVersion)
5353
if deploymentVersion != nil {
54-
packag := model.GetOne[model.Package]("id", deploymentVersion.CurrentPackage)
55-
if packag != nil {
56-
// && *packag.Hash != packageHash
57-
updateInfoRedis.TargetBinaryRange = *deploymentVersion.AppVersion
58-
updateInfoRedis.PackageHash = *packag.Hash
59-
updateInfoRedis.PackageSize = *packag.Size
60-
updateInfoRedis.IsAvailable = true
61-
updateInfoRedis.IsMandatory = true
62-
label := strconv.Itoa(*packag.Id)
63-
updateInfoRedis.Label = label
64-
updateInfoRedis.DownloadUrl = config.ResourceUrl + *packag.Download
65-
updateInfoRedis.Description = *packag.Description
54+
if deploymentVersion.CurrentPackage != nil {
55+
packag := model.GetOne[model.Package]("id", deploymentVersion.CurrentPackage)
56+
if packag != nil {
57+
// && *packag.Hash != packageHash
58+
updateInfoRedis.TargetBinaryRange = *deploymentVersion.AppVersion
59+
updateInfoRedis.PackageHash = *packag.Hash
60+
updateInfoRedis.PackageSize = *packag.Size
61+
updateInfoRedis.IsAvailable = true
62+
updateInfoRedis.IsMandatory = true
63+
label := strconv.Itoa(*packag.Id)
64+
updateInfoRedis.Label = label
65+
updateInfoRedis.DownloadUrl = config.ResourceUrl + *packag.Download
66+
if packag.Description != nil {
67+
updateInfoRedis.Description = *packag.Description
68+
}
69+
}
6670
}
6771
}
6872
deploymentVersionNew := model.DeploymentVersion{}.GetNewVersionByKeyDeploymentId(*deployment.Id)

0 commit comments

Comments
 (0)