undo extra move

This commit is contained in:
danochoa 2024-12-31 01:43:39 -06:00
parent 8390b4154b
commit 61ffbe157d

View file

@ -51,6 +51,14 @@ func NewCmdDelete(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co
func deleteRun(opts *DeleteOptions) error {
gistID := opts.Selector
if strings.Contains(gistID, "/") {
id, err := shared.GistIDFromURL(gistID)
if err != nil {
return err
}
gistID = id
}
client, err := opts.HttpClient()
if err != nil {
return err
@ -76,14 +84,6 @@ func deleteRun(opts *DeleteOptions) error {
}
}
if strings.Contains(gistID, "/") {
id, err := shared.GistIDFromURL(gistID)
if err != nil {
return err
}
gistID = id
}
apiClient := api.NewClientFromHTTP(client)
if err := deleteGist(apiClient, host, gistID); err != nil {
if errors.Is(err, shared.NotFoundErr) {