Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional description for packages #2

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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