@@ -115,6 +115,7 @@ func handleCheckOnly() error {
115115 notes := formatReleaseNotes (result .Release .ReleaseNotes )
116116 if notes != "" {
117117 fmt .Printf ("\n %s\n " , ui .PageSubtitle .Render ("Release Notes:" ))
118+ // Avoid trailing blank line after notes
118119 fmt .Printf ("%s\n " , ui .FeedbackText .Render (notes ))
119120 }
120121 }
@@ -161,14 +162,15 @@ func handleUpdateFlow(autoYes bool) error {
161162 }
162163
163164 // Show update information
164- fmt .Printf ("\n %s\n " , ui .PageTitle .Render ("Update Available" ))
165- fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("FontGet v%s is available (you have v%s). " , result .Latest , result . Current )))
165+ fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt . Sprintf ( "Current Installed Version: %s" , result . Current ) ))
166+ fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("Version Available: %s " , result .Latest )))
166167
167168 // Show release notes if available
168169 if result .Release != nil && result .Release .ReleaseNotes != "" {
169170 notes := formatReleaseNotes (result .Release .ReleaseNotes )
170171 if notes != "" {
171172 fmt .Printf ("\n %s\n " , ui .PageSubtitle .Render ("Release Notes:" ))
173+ // Avoid trailing blank line after notes
172174 fmt .Printf ("%s\n " , ui .FeedbackText .Render (notes ))
173175 }
174176 }
@@ -180,7 +182,7 @@ func handleUpdateFlow(autoYes bool) error {
180182
181183 confirmed , err := components .RunConfirm (
182184 "Update FontGet" ,
183- fmt .Sprintf ("Do you want to update FontGet from v %s to v %s?" , result .Current , result .Latest ),
185+ fmt .Sprintf ("Do you want to update FontGet from %s to %s?" , result .Current , result .Latest ),
184186 )
185187 if err != nil {
186188 if logger != nil {
@@ -224,13 +226,14 @@ func handleUpdateToVersion(targetVersion string, autoYes bool) error {
224226
225227 // Check if target version is different from current
226228 if targetVersion == currentVersion {
227- fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("FontGet is already at version v %s" , currentVersion )))
229+ fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("FontGet is already at version %s" , currentVersion )))
228230 return nil
229231 }
230232
231233 // Show update information
232234 fmt .Printf ("\n %s\n " , ui .PageTitle .Render ("Update to Specific Version" ))
233- fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("Updating FontGet from v%s to v%s" , currentVersion , targetVersion )))
235+ fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("Current Installed Version: %s" , currentVersion )))
236+ fmt .Printf ("%s\n " , ui .FeedbackInfo .Render (fmt .Sprintf ("Version Available: %s" , targetVersion )))
234237
235238 // Prompt for confirmation unless auto-yes
236239 if ! autoYes {
@@ -239,7 +242,7 @@ func handleUpdateToVersion(targetVersion string, autoYes bool) error {
239242
240243 confirmed , err := components .RunConfirm (
241244 "Update FontGet" ,
242- fmt .Sprintf ("Do you want to update FontGet from v %s to v %s?" , currentVersion , targetVersion ),
245+ fmt .Sprintf ("Do you want to update FontGet from %s to %s?" , currentVersion , targetVersion ),
243246 )
244247 if err != nil {
245248 if logger != nil {
@@ -269,7 +272,13 @@ func handleUpdateToVersion(targetVersion string, autoYes bool) error {
269272 output .GetVerbose ().Info ("Starting update to version %s" , targetVersion )
270273 output .GetDebug ().State ("Calling update.UpdateToVersion(%s)" , targetVersion )
271274
272- err := update .UpdateToVersion (targetVersion )
275+ err := ui .RunSpinner (
276+ fmt .Sprintf ("Updating FontGet from %s to %s..." , currentVersion , targetVersion ),
277+ fmt .Sprintf ("Successfully updated to FontGet %s" , targetVersion ),
278+ func () error {
279+ return update .UpdateToVersion (targetVersion )
280+ },
281+ )
273282 if err != nil {
274283 if logger != nil {
275284 logger .Error ("Failed to update to version %s: %v" , targetVersion , err )
@@ -286,8 +295,7 @@ func handleUpdateToVersion(targetVersion string, autoYes bool) error {
286295
287296 output .GetVerbose ().Info ("Update complete" )
288297 output .GetDebug ().State ("Update successful" )
289- fmt .Printf ("%s\n " , ui .FeedbackSuccess .Render (fmt .Sprintf ("FontGet updated successfully from v%s to v%s" , currentVersion , targetVersion )))
290- fmt .Printf ("%s\n " , ui .FeedbackText .Render ("Restart FontGet to use the new version." ))
298+ fmt .Printf ("%s\n " , ui .FeedbackSuccess .Render (fmt .Sprintf ("Successfully updated to FontGet %s" , targetVersion )))
291299
292300 return nil
293301}
@@ -298,7 +306,14 @@ func performUpdate(currentVersion, latestVersion string) error {
298306 output .GetVerbose ().Info ("Starting update to version %s" , latestVersion )
299307 output .GetDebug ().State ("Calling update.UpdateToLatest()" )
300308
301- err := update .UpdateToLatest ()
309+ // Show spinner while performing the update
310+ err := ui .RunSpinner (
311+ fmt .Sprintf ("Updating FontGet from %s to %s..." , currentVersion , latestVersion ),
312+ fmt .Sprintf ("Successfully updated to FontGet %s" , latestVersion ),
313+ func () error {
314+ return update .UpdateToLatest ()
315+ },
316+ )
302317 if err != nil {
303318 if logger != nil {
304319 logger .Error ("Failed to update: %v" , err )
@@ -315,8 +330,7 @@ func performUpdate(currentVersion, latestVersion string) error {
315330
316331 output .GetVerbose ().Info ("Update complete" )
317332 output .GetDebug ().State ("Update successful" )
318- fmt .Printf ("%s\n " , ui .FeedbackSuccess .Render (fmt .Sprintf ("FontGet updated successfully from v%s to v%s" , currentVersion , latestVersion )))
319- fmt .Printf ("%s\n " , ui .FeedbackText .Render ("Restart FontGet to use the new version." ))
333+ fmt .Printf ("%s\n " , ui .FeedbackSuccess .Render (fmt .Sprintf ("Successfully updated to FontGet %s" , latestVersion )))
320334
321335 return nil
322336}
@@ -328,6 +342,12 @@ func formatReleaseNotes(notes string) string {
328342 }
329343
330344 lines := strings .Split (notes , "\n " )
345+
346+ // Trim trailing empty lines to avoid extra blank space at the end
347+ for len (lines ) > 0 && strings .TrimSpace (lines [len (lines )- 1 ]) == "" {
348+ lines = lines [:len (lines )- 1 ]
349+ }
350+
331351 maxLines := 10
332352 if len (lines ) > maxLines {
333353 lines = lines [:maxLines ]
0 commit comments