Added whether the gist is public or secret. Added the colour red to public and the colour green to secret
This commit is contained in:
parent
02881b4783
commit
df2b19567b
1 changed files with 6 additions and 3 deletions
|
|
@ -115,6 +115,7 @@ func createRun(opts *CreateOptions) error {
|
|||
return fmt.Errorf("failed to collect files for posting: %w", err)
|
||||
}
|
||||
|
||||
cs := opts.IO.ColorScheme()
|
||||
gistName := guessGistName(files)
|
||||
|
||||
processMessage := "Creating gist..."
|
||||
|
|
@ -125,11 +126,13 @@ func createRun(opts *CreateOptions) error {
|
|||
} else {
|
||||
processMessage = fmt.Sprintf("Creating gist %s", gistName)
|
||||
}
|
||||
completionMessage = fmt.Sprintf("Created gist %s", gistName)
|
||||
if opts.Public {
|
||||
completionMessage = fmt.Sprintf("Created %s gist %s", cs.Red("public"), gistName)
|
||||
} else {
|
||||
completionMessage = fmt.Sprintf("Created %s gist %s", cs.Green("secret"), gistName)
|
||||
}
|
||||
}
|
||||
|
||||
cs := opts.IO.ColorScheme()
|
||||
|
||||
errOut := opts.IO.ErrOut
|
||||
fmt.Fprintf(errOut, "%s %s\n", cs.Gray("-"), processMessage)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue