Version 1.0.0, release build script
- version.go/version.txt, --version flag, version in the help title - build.sh builds static binaries for macOS and Linux into ./bin - make build/install inject version.txt, make dist runs build.sh - README: binary downloads; development docs: release process Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
156bb18c91
commit
e5750ef24b
9 files changed
+162
-9
No files matched your search
+5
-1
@@ -98,6 +98,7 @@ type App struct {
|
||||
statusStyle lipgloss.Style
|
||||
quitAfterSave bool
|
||||
autoReload bool
|
||||
version string
|
||||
|
||||
// Screen regions from the last render, for mouse handling.
|
||||
catRect, optRect, docRect rect
|
||||
@@ -155,6 +156,9 @@ func New(sch *schema.Schema, gh *ghostty.Ghostty, file *config.File) *App {
|
||||
// after every save (on by default).
|
||||
func (a *App) SetAutoReload(on bool) { a.autoReload = on }
|
||||
|
||||
// SetVersion sets the program version shown in the help.
|
||||
func (a *App) SetVersion(v string) { a.version = v }
|
||||
|
||||
func (a *App) Init() tea.Cmd {
|
||||
if a.gh == nil {
|
||||
return nil
|
||||
@@ -403,7 +407,7 @@ func (a *App) updateBrowse(km tea.KeyMsg) tea.Cmd {
|
||||
case "q":
|
||||
return a.quit()
|
||||
case "?", "f1":
|
||||
a.dlg = helpDialog()
|
||||
a.dlg = helpDialog(a.version)
|
||||
return nil
|
||||
case "/", "ctrl+f":
|
||||
// Every search starts fresh, like "/" in less or vim.
|
||||
|
||||
@@ -99,10 +99,14 @@ func (d *dialog) view(width, height int) string {
|
||||
return framed(d.title, content, w, len(lines)+2, color)
|
||||
}
|
||||
|
||||
func helpDialog() *dialog {
|
||||
func helpDialog(version string) *dialog {
|
||||
k := func(key, desc string) string { return stKey.Render(fit(key, 16)) + desc }
|
||||
title := "Help"
|
||||
if version != "" {
|
||||
title = "Help · ghosttyconf " + version
|
||||
}
|
||||
return &dialog{
|
||||
title: "Help",
|
||||
title: title,
|
||||
lines: []string{
|
||||
stBold.Render("Browsing"),
|
||||
k("↑↓ / j k", "move"),
|
||||
|
||||
Reference in new issue
Block a user