diff --git a/in_command.go b/in_command.go index fcf27e5..1f05f72 100644 --- a/in_command.go +++ b/in_command.go @@ -94,6 +94,11 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) { Version: Version{ Tag: *foundRelease.TagName, }, + Metadata: []MetadataPair{ + {Name: "name", Value: *foundRelease.Name, URL: *foundRelease.HTMLURL}, + {Name: "url", Value: *foundRelease.HTMLURL}, + {Name: "body", Value: *foundRelease.Body, Markdown: true}, + }, }, nil } diff --git a/in_command_test.go b/in_command_test.go index c92b743..6d0a9c3 100644 --- a/in_command_test.go +++ b/in_command_test.go @@ -55,9 +55,16 @@ var _ = Describe("In Command", func() { }) buildRelease := func(id int, tag string) github.RepositoryRelease { + url := "http://google.com" + name := "release-name" + body := "*markdown*" + return github.RepositoryRelease{ ID: &id, TagName: &tag, + HTMLURL: &url, + Name: &name, + Body: &body, } } @@ -106,6 +113,14 @@ var _ = Describe("In Command", func() { Ω(inResponse.Version).Should(Equal(resource.Version{Tag: "v0.35.0"})) }) + It("has some sweet metadata", func() { + Ω(inResponse.Metadata).Should(ConsistOf( + resource.MetadataPair{Name: "url", Value: "http://google.com"}, + resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, + resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, + )) + }) + It("downloads only the files that match the globs", func() { _, err := os.Stat(filepath.Join(destDir, "example.txt")) Ω(err).ShouldNot(HaveOccurred()) diff --git a/resources.go b/resources.go index 3af0b8a..f91efd1 100644 --- a/resources.go +++ b/resources.go @@ -50,6 +50,8 @@ type Version struct { } type MetadataPair struct { - Name string `json:"name"` - Value string `json:"value"` + Name string `json:"name"` + Value string `json:"value"` + URL string `json:"url"` + Markdown bool `json:"markdown"` }