From a33e03a547b934d2b62f42d0888d77c2addbd012 Mon Sep 17 00:00:00 2001 From: Esben von Buchwald Date: Wed, 22 May 2024 15:02:49 +0200 Subject: [PATCH] Add optional description for packages --- README.md | 2 +- opt/app.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59b536c..a225944 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ chmod +x code-push-go ./code-push-go app create_deployment -n -dn #Update react native -./code-push-go create_bundle -t -n -d -p <(*Optional) React native project default:./> +./code-push-go create_bundle -t -n -d -p <(*Optional) React native project default:./> --description <(*Optional) Description default: ""/> ``` ## License diff --git a/opt/app.go b/opt/app.go index 8a20dbd..824aff7 100644 --- a/opt/app.go +++ b/opt/app.go @@ -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 -n -d -p <*Optional React native project dir>") + fmt.Println("Usage: code-push-go create_bundle -t -n -d -p <*Optional React native project dir> --description <*Optional Description>") return } log.Println("Get app info...") @@ -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)) @@ -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) {