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:
Lucas 2025-09-18 06:35:35 +02:00
parent 704bb4164c
commit bf272305ff
No known key found for this signature in database

View file

@ -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,