Skip to content

Commit 3b62d79

Browse files
committed
notes
1 parent a62f298 commit 3b62d79

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

command/gist.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func gistCreate(cmd *cobra.Command, args []string) error {
3434
return err
3535
}
3636

37+
// TODO ??
38+
ok, err := client.EnsureScope("gist")
39+
3740
description, err := cmd.Flags().GetString("description")
3841
if err != nil {
3942
return err
@@ -61,6 +64,7 @@ func gistCreate(cmd *cobra.Command, args []string) error {
6164

6265
fmt.Fprintf(colorableErr(cmd), "\nCreating a Gist for %s\n\n", user)
6366

67+
// Need a prior request (or a change to the reauth code)
6468
gist, err := api.GistCreate(client, description, public, filename)
6569
if err != nil {
6670
return fmt.Errorf("Failed to create a gist: %w", err)

command/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ var apiClientForContext = func(ctx context.Context) (*api.Client, error) {
174174

175175
opts = append(opts,
176176
api.CheckScopes("read:org", checkScopesFunc),
177-
api.CheckScopes("gist", checkScopesFunc),
177+
api.CheckScopes("gist", checkScopesFunc), // TODO take this out and rely on per-gist-invocation reauth
178178
api.AddHeaderFunc("Authorization", getAuthValue),
179179
api.AddHeader("User-Agent", fmt.Sprintf("GitHub CLI %s", Version)),
180180
// antiope-preview: Checks

0 commit comments

Comments
 (0)