| 117 | } |
| 118 | |
| 119 | func editArgs(config editConfig) (*updateProjectMutation, map[string]interface{}) { |
| 120 | variables := githubv4.UpdateProjectV2Input{ProjectID: githubv4.ID(config.opts.projectID)} |
| 121 | if config.opts.title != "" { |
| 122 | variables.Title = githubv4.NewString(githubv4.String(config.opts.title)) |
| 123 | } |
| 124 | if config.opts.shortDescription != "" { |
| 125 | variables.ShortDescription = githubv4.NewString(githubv4.String(config.opts.shortDescription)) |
| 126 | } |
| 127 | if config.opts.readme != "" { |
| 128 | variables.Readme = githubv4.NewString(githubv4.String(config.opts.readme)) |
| 129 | } |
| 130 | if config.opts.visibility != "" { |
| 131 | if config.opts.visibility == projectVisibilityPublic { |
| 132 | variables.Public = githubv4.NewBoolean(githubv4.Boolean(true)) |
| 133 | } else if config.opts.visibility == projectVisibilityPrivate { |
| 134 | variables.Public = githubv4.NewBoolean(githubv4.Boolean(false)) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | return &updateProjectMutation{}, map[string]interface{}{ |
| 139 | "input": variables, |
| 140 | "firstItems": githubv4.Int(0), |
| 141 | "afterItems": (*githubv4.String)(nil), |
| 142 | "firstFields": githubv4.Int(0), |
| 143 | "afterFields": (*githubv4.String)(nil), |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func printResults(config editConfig, project queries.ProjectMutationQuery) error { |
| 148 | if !config.io.IsStdoutTTY() { |