docs: don't create docs file for empty packages
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
5537ab33de
commit
606398b69a
@ -327,12 +327,6 @@ func walkStdlib(ctx context.Context, output, format string) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := os.Create(filepath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer f.Close()
|
|
||||||
|
|
||||||
pkg := fmt.Sprintf("dagger.io/%s", p)
|
pkg := fmt.Sprintf("dagger.io/%s", p)
|
||||||
lg.Info().Str("package", pkg).Str("format", format).Msg("generating doc")
|
lg.Info().Str("package", pkg).Str("format", format).Msg("generating doc")
|
||||||
val, err := loadCode(pkg)
|
val, err := loadCode(pkg)
|
||||||
@ -344,6 +338,12 @@ func walkStdlib(ctx context.Context, output, format string) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f, err := os.Create(filepath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
PrintDoc(ctx, f, pkg, val, format)
|
PrintDoc(ctx, f, pkg, val, format)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user