mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Merge branch 'fix-reproducibility' of https://github.com/3pleX-dev/kitty
This commit is contained in:
@@ -4,6 +4,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kitty/tools/cli/markup"
|
"kitty/tools/cli/markup"
|
||||||
@@ -22,6 +23,7 @@ func fish_completion_script(commands []string) (string, error) {
|
|||||||
}
|
}
|
||||||
if len(commands) == 0 {
|
if len(commands) == 0 {
|
||||||
commands = append(commands, utils.Keys(all_commands)...)
|
commands = append(commands, utils.Keys(all_commands)...)
|
||||||
|
sort.Strings(commands)
|
||||||
}
|
}
|
||||||
script := strings.Builder{}
|
script := strings.Builder{}
|
||||||
script.WriteString(`function __ksi_completions
|
script.WriteString(`function __ksi_completions
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
@@ -135,6 +136,15 @@ func ShowHelpInPager(text string) {
|
|||||||
_ = pager.Run()
|
_ = pager.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getDeterministicTimestamp() time.Time {
|
||||||
|
if epochStr, exists := os.LookupEnv("SOURCE_DATE_EPOCH"); exists {
|
||||||
|
if epoch, err := strconv.ParseInt(epochStr, 10, 64); err == nil {
|
||||||
|
return time.Unix(epoch, 0).UTC()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return time.Now()
|
||||||
|
}
|
||||||
|
|
||||||
func (self *Command) GenerateManPages(level int, recurse bool) (err error) {
|
func (self *Command) GenerateManPages(level int, recurse bool) (err error) {
|
||||||
var names []string
|
var names []string
|
||||||
p := self
|
p := self
|
||||||
@@ -149,7 +159,7 @@ func (self *Command) GenerateManPages(level int, recurse bool) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer outf.Close()
|
defer outf.Close()
|
||||||
fmt.Fprintf(outf, `.TH "%s" "1" "%s" "%s" "%s"`, name, time.Now().Format("Jan 02, 2006"), kitty.VersionString, "kitten Manual")
|
fmt.Fprintf(outf, `.TH "%s" "1" "%s" "%s" "%s"`, name, getDeterministicTimestamp().Format("Jan 02, 2006"), kitty.VersionString, "kitten Manual")
|
||||||
fmt.Fprintln(outf)
|
fmt.Fprintln(outf)
|
||||||
fmt.Fprintln(outf, ".SH Name")
|
fmt.Fprintln(outf, ".SH Name")
|
||||||
fmt.Fprintln(outf, name, "\\-", escape_text_for_man(self.ShortDescription))
|
fmt.Fprintln(outf, name, "\\-", escape_text_for_man(self.ShortDescription))
|
||||||
|
|||||||
Reference in New Issue
Block a user