diff options
author | Brian Smith <brian@briansmith.org> | 2015-08-10 00:08:49 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-08-19 03:45:42 +0300 |
commit | 55a3cf4ad5ea1639cc0d43ae1ed856b83debf809 (patch) | |
tree | 981a0b3bace1903078090af7ee2df786fb80d07d /util | |
parent | 6488725e5e1ba04276733f67035ae44abd6641ec (diff) |
Fix documentation generation on Windows.
Previously doc/doc.css was a symlink to util/doc.css, but symlinks
don't work well on Windows. Now util/doc.css is copied to the output
directory when the documentation is generated.
Change-Id: I2c9f4fee4f4307cc3dd70c4be380b4551d5e9ab5
Reviewed-on: https://boringssl-review.googlesource.com/5677
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/doc.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/util/doc.go b/util/doc.go index 540d6ca1..0ab6f892 100644 --- a/util/doc.go +++ b/util/doc.go @@ -605,6 +605,14 @@ func generateIndex(outPath string, config *Config, headerDescriptions map[string return nil } +func copyFile(outPath string, inFilePath string) error { + bytes, err := ioutil.ReadFile(inFilePath) + if err != nil { + return err + } + return ioutil.WriteFile(filepath.Join(outPath, filepath.Base(inFilePath)), bytes, 0666) +} + func main() { var ( configFlag *string = flag.String("config", "doc.config", "Location of config file") @@ -645,4 +653,9 @@ func main() { fmt.Printf("Failed to generate index: %s\n", err) os.Exit(1) } + + if err := copyFile(*outputDir, "doc.css"); err != nil { + fmt.Printf("Failed to copy static file: %s\n", err) + os.Exit(1) + } } |