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`.
This commit is contained in:
parent
704bb4164c
commit
bf272305ff
1 changed files with 9 additions and 0 deletions
|
|
@ -155,6 +155,15 @@ func editRun(opts *EditOptions) error {
|
|||
// Transform our gist into the schema that the update endpoint expects
|
||||
filesToupdate := make(map[string]*gistFileToUpdate, len(gist.Files))
|
||||
for filename, file := range gist.Files {
|
||||
if file.Truncated {
|
||||
fullContent, err := shared.GetRawGistFile(client, file.RawURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
file.Content = fullContent
|
||||
}
|
||||
|
||||
filesToupdate[filename] = &gistFileToUpdate{
|
||||
Content: file.Content,
|
||||
NewFilename: file.Filename,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue