Skip to content

Commit

Permalink
Merge pull request #2 from esbenvb/patch1
Browse files Browse the repository at this point in the history
Add optional description for packages
  • Loading branch information
htdcx authored May 23, 2024
2 parents 69b78b8 + a33e03a commit de6ff88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ chmod +x code-push-go
./code-push-go app create_deployment -n <AppName> -dn <DeploymentName>

#Update react native
./code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <DeploymentName> -p <(*Optional) React native project default:./>
./code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <DeploymentName> -p <(*Optional) React native project default:./> --description <(*Optional) Description default: ""/>
```

## License
Expand Down
6 changes: 5 additions & 1 deletion opt/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ func (App) CreateBundle() {
var appName string
var deployment string
var rnDir string
var description string

flag.StringVar(&targetVersion, "t", "", "Target version")
flag.StringVar(&appName, "n", "", "AppName")
flag.StringVar(&deployment, "d", "", "DeploymentName")
flag.StringVar(&rnDir, "p", "./", "React native project dir")
flag.StringVar(&description, "description", "", "Description")
flag.Parse()

if targetVersion == "" || appName == "" || deployment == "" {
fmt.Println("Usage: code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <deployment> -p <*Optional React native project dir>")
fmt.Println("Usage: code-push-go create_bundle -t <TargetVersion> -n <AppName> -d <deployment> -p <*Optional React native project dir> --description <*Optional Description>")
return
}
log.Println("Get app info...")
Expand Down Expand Up @@ -172,6 +174,7 @@ func (App) CreateBundle() {
AppName: &appName,
Deployment: &deployment,
Hash: &hash,
Description: &description,
}
jsonByte, _ = json.Marshal(createBundleReq)
req, _ = http.NewRequest("POST", Url.String(), bytes.NewBuffer(jsonByte))
Expand Down Expand Up @@ -280,6 +283,7 @@ type createBundleReq struct {
Version *string `json:"version" binding:"required"`
Size *int64 `json:"size" binding:"required"`
Hash *string `json:"hash" binding:"required"`
Description *string `json:"description" binding:"required"`
}

func (a App) App(arge []string) {
Expand Down

0 comments on commit de6ff88

Please sign in to comment.