gen-manpages: Create man directory if it does not exist

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
This commit is contained in:
Eli Uriegas 2019-09-23 20:31:26 +00:00
parent 1af133f6c5
commit 2a636f8c34
No known key found for this signature in database
GPG Key ID: 611F3B998E7A2333

View File

@ -49,6 +49,9 @@ func run() error {
if err != nil {
return err
}
if _, err := os.Stat(dir); os.IsNotExist(err) {
os.Mkdir(dir, os.ModePerm)
}
if err := ioutil.WriteFile(filepath.Join(dir, fmt.Sprintf("%s.1", name)), []byte(data), 0644); err != nil {
return err
}