From c29b8dea46bb1e53494dd9595805587b1f4aa95a Mon Sep 17 00:00:00 2001 From: Rohit Nayak Date: Sat, 14 Dec 2024 23:49:02 +0100 Subject: [PATCH] Remove commit hash from docs. Fix issue with workdir replacement Signed-off-by: Rohit Nayak --- go/cmd/internal/docgen/docgen.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go/cmd/internal/docgen/docgen.go b/go/cmd/internal/docgen/docgen.go index eea935ed396..4a13a174f3d 100644 --- a/go/cmd/internal/docgen/docgen.go +++ b/go/cmd/internal/docgen/docgen.go @@ -194,7 +194,7 @@ func anonymizeHomedir(file string) (err error) { // We're replacing the stuff inside the square brackets in the example sed // below: // 's:Paths to search for config files in. (default \[.*\])$:Paths to search for config files in. (default \[\]):' - sed := exec.Command("sed", "-i", "-e", fmt.Sprintf("s:%s::i", wd), file) + sed := exec.Command("sed", "-i", "", "-e", fmt.Sprintf("s:%s:%s:", wd, ""), file) if out, err := sed.CombinedOutput(); err != nil { return fmt.Errorf("%w: %s", err, out) } @@ -224,7 +224,6 @@ func getCommitID(ref string) (string, error) { const frontmatter = `--- title: %s series: %s -commit: %s --- ` @@ -240,7 +239,7 @@ func frontmatterFilePrepender(sha string) func(filename string) string { cmdName = strings.ReplaceAll(cmdName, "_", " ") - return fmt.Sprintf(frontmatter, cmdName, root, sha) + return fmt.Sprintf(frontmatter, cmdName, root) } }