MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / RenderPMInstructions

Function RenderPMInstructions

tui/update.go:68–97  ·  view source on GitHub ↗
(pm, currentVer, latestVer string)

Source from the content-addressed store, hash-verified

66}
67
68func RenderPMInstructions(pm, currentVer, latestVer string) string {
69 InitCommonStyles(os.Stdout)
70 styles := newUpdateStyles()
71
72 var content strings.Builder
73 content.WriteString(fmt.Sprintf("Update available: %s → %s\n\n",
74 styles.version.Render(currentVer),
75 styles.version.Render(latestVer)))
76
77 var pmName, command string
78 switch pm {
79 case "homebrew":
80 pmName = "Homebrew"
81 command = "brew update && brew upgrade tnr"
82 case "scoop":
83 pmName = "Scoop"
84 command = "scoop update tnr"
85 case "winget":
86 pmName = "Windows Package Manager"
87 command = "winget upgrade Thunder.tnr"
88 default:
89 pmName = "a package manager"
90 command = "brew upgrade tnr"
91 }
92
93 content.WriteString(fmt.Sprintf("This installation is managed by %s.\n", pmName))
94 content.WriteString(fmt.Sprintf("Run: %s", styles.command.Render(command)))
95
96 return styles.pmBox.Render(content.String())
97}
98
99func RenderUpdateSuccess() string {
100 InitCommonStyles(os.Stdout)

Callers 2

handlePMUpdateFunction · 0.92

Calls 2

InitCommonStylesFunction · 0.85
newUpdateStylesFunction · 0.85

Tested by 1