Skip to content

Commit bf27230

Browse files
committed
feat(gist): retrieve full content for truncated gist files
* Added logic to fetch full content for truncated files when updating a gist. * Utilizes `shared.GetRawGistFile` to retrieve the complete content based on the `RawURL`.
1 parent 704bb41 commit bf27230

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/cmd/gist/edit/edit.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ func editRun(opts *EditOptions) error {
155155
// Transform our gist into the schema that the update endpoint expects
156156
filesToupdate := make(map[string]*gistFileToUpdate, len(gist.Files))
157157
for filename, file := range gist.Files {
158+
if file.Truncated {
159+
fullContent, err := shared.GetRawGistFile(client, file.RawURL)
160+
if err != nil {
161+
return err
162+
}
163+
164+
file.Content = fullContent
165+
}
166+
158167
filesToupdate[filename] = &gistFileToUpdate{
159168
Content: file.Content,
160169
NewFilename: file.Filename,

0 commit comments

Comments
 (0)