Skip to content

Commit 9ff35c3

Browse files
committed
delete: simplify and document in readme
1 parent 2f93b00 commit 9ff35c3

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ $ github-release upload --user aktau \
4343
# upload other files...
4444
```
4545

46+
# you're not happy with it, so delete it
47+
$ github-release delete --user aktau \
48+
--repo gofinance \
49+
--tag v0.1.0
50+
4651
Copyright
4752
=========
4853

github-release.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Options struct {
3131
Repo string `goptions:"-r, --repo, description='Github repo (required if $GITHUB_REPO not set)'"`
3232
Tag string `goptions:"-t, --tag, obligatory, description='Git tag to create a release from'"`
3333
Name string `goptions:"-n, --name, description='Name of the release (defaults to tag)'"`
34-
Desc string `goptions:"-d, --description, description='Description of the release (defauls to tag)'"`
34+
Desc string `goptions:"-d, --description, description='Description of the release (defaults to tag)'"`
3535
Draft bool `goptions:"--draft, description='The release is a draft'"`
3636
Prerelease bool `goptions:"-p, --pre-release, description='The release is a pre-release'"`
3737
} `goptions:"release"`
@@ -267,23 +267,10 @@ func deletecmd(opt Options) error {
267267
}
268268

269269
func httpDelete(url, token string) (*http.Response, error) {
270-
req, err := NewAuthRequest("DELETE", url, "application/json", token, nil)
271-
if err != nil {
272-
return nil, err
273-
}
274-
275-
// req.Close = true
276-
// req.Header.Set("Accept", "application/vnd.github.manifold-preview")
277-
278-
resp, err := http.DefaultClient.Do(req)
270+
resp, err := DoAuthRequest("DELETE", url, "application/json", token, nil)
279271
if err != nil {
280272
return nil, err
281273
}
282274

283275
return resp, nil
284276
}
285-
286-
/* fetches the id that corresponds to a tag */
287-
func idOfTag(tag string) int {
288-
return 0
289-
}

0 commit comments

Comments
 (0)