Skip to content

Commit

Permalink
Hide stream-share command reference (#1518)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianstrauch authored Nov 10, 2022
1 parent 5fd0420 commit 35d225b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cmd/docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"os"
"path/filepath"
"regexp"

orgv1 "github.com/confluentinc/cc-structs/kafka/org/v1"

Expand Down Expand Up @@ -48,7 +50,28 @@ func main() {
panic(err)
}

removeDocumentation()

if err := os.Setenv("HOME", currentHOME); err != nil {
panic(err)
}
}

// removeDocumentation hides documentation for unreleased features
func removeDocumentation() {
out, err := os.ReadFile(filepath.Join("docs", "index.rst"))
if err != nil {
panic(err)
}

re := regexp.MustCompile(`\s{3}stream-share/index\n`)
out = re.ReplaceAll(out, []byte(""))

if err := os.WriteFile(filepath.Join("docs", "index.rst"), out, 0644); err != nil {
panic(err)
}

if err := os.RemoveAll(filepath.Join("docs", "stream-share")); err != nil {
panic(err)
}
}

0 comments on commit 35d225b

Please sign in to comment.