Skip to content

Commit 61de93b

Browse files
docs: update docs cmd to remove directory before generating (#1180)
Signed-off-by: Darren Murray <[email protected]>
1 parent 9ed2b12 commit 61de93b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli/cmd/docs.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@ func init() {
6464
}
6565

6666
func GenerateMarkdownDocs(location string) error {
67-
// if the location doesn't exist, we will create it for the user
68-
if err := os.MkdirAll(location, 0755); err != nil {
67+
// remove location before generating to ensure deleted commands are removed
68+
err := os.RemoveAll(location)
69+
if err != nil {
70+
return err
71+
}
72+
73+
if err = os.MkdirAll(location, 0755); err != nil {
6974
return err
7075
}
7176

0 commit comments

Comments
 (0)