This commit is contained in:
vilmibm 2020-05-15 09:52:06 -05:00
parent a62f2987c0
commit 3b62d79e81
2 changed files with 5 additions and 1 deletions

View file

@ -34,6 +34,9 @@ func gistCreate(cmd *cobra.Command, args []string) error {
return err
}
// TODO ??
ok, err := client.EnsureScope("gist")
description, err := cmd.Flags().GetString("description")
if err != nil {
return err
@ -61,6 +64,7 @@ func gistCreate(cmd *cobra.Command, args []string) error {
fmt.Fprintf(colorableErr(cmd), "\nCreating a Gist for %s\n\n", user)
// Need a prior request (or a change to the reauth code)
gist, err := api.GistCreate(client, description, public, filename)
if err != nil {
return fmt.Errorf("Failed to create a gist: %w", err)

View file

@ -174,7 +174,7 @@ var apiClientForContext = func(ctx context.Context) (*api.Client, error) {
opts = append(opts,
api.CheckScopes("read:org", checkScopesFunc),
api.CheckScopes("gist", checkScopesFunc),
api.CheckScopes("gist", checkScopesFunc), // TODO take this out and rely on per-gist-invocation reauth
api.AddHeaderFunc("Authorization", getAuthValue),
api.AddHeader("User-Agent", fmt.Sprintf("GitHub CLI %s", Version)),
// antiope-preview: Checks