Skip to content

Commit

Permalink
Remove commit hash from docs. Fix issue with workdir replacement
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Dec 14, 2024
1 parent 69f2f8f commit c29b8de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go/cmd/internal/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 \[<WORKDIR>\]):'
sed := exec.Command("sed", "-i", "-e", fmt.Sprintf("s:%s:<WORKDIR>:i", wd), file)
sed := exec.Command("sed", "-i", "", "-e", fmt.Sprintf("s:%s:%s:", wd, "<WORKDIR>"), file)
if out, err := sed.CombinedOutput(); err != nil {
return fmt.Errorf("%w: %s", err, out)
}
Expand Down Expand Up @@ -224,7 +224,6 @@ func getCommitID(ref string) (string, error) {
const frontmatter = `---
title: %s
series: %s
commit: %s
---
`

Expand All @@ -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)
}
}

Expand Down

0 comments on commit c29b8de

Please sign in to comment.