diff options
| author | Jamal Carvalho <jamal@golang.org> | 2021-05-17 18:02:36 -0400 |
|---|---|---|
| committer | Jamal Carvalho <jamal@golang.org> | 2021-05-19 18:22:06 +0000 |
| commit | 5af346b6cde5a95e66ea9cd546986c205f5d4054 (patch) | |
| tree | af878bbf541657ea8c42e493221be8c2a5176755 /devtools | |
| parent | 97d0b246dc57dc42c127770336c702bd3c5fe984 (diff) | |
| download | go-x-pkgsite-5af346b6cde5a95e66ea9cd546986c205f5d4054.tar.xz | |
devtools,internal: adds support for building styleguide assets
Change-Id: I6bd95b076c1e2715ae574d2802ca75a71bb3e747
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320652
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'devtools')
| -rw-r--r-- | devtools/cmd/static/main.go | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/devtools/cmd/static/main.go b/devtools/cmd/static/main.go index e7eb61d3..8600cd5b 100644 --- a/devtools/cmd/static/main.go +++ b/devtools/cmd/static/main.go @@ -7,34 +7,19 @@ package main import ( - "bytes" - "flag" - "io/ioutil" "log" "golang.org/x/pkgsite/internal/static" ) -var check = flag.Bool("check", false, "disable write mode and check that output files are valid") - func main() { - flag.Parse() - - staticPath := "content/static" - result, err := static.Build(static.Config{StaticPath: staticPath, Write: !*check}) + _, err := static.Build(static.Config{StaticPath: "content/static/js", Write: true}) if err != nil { log.Fatal(err) } - if *check { - for _, v := range result.OutputFiles { - file, err := ioutil.ReadFile(v.Path) - if err != nil { - log.Fatal(err) - } - if !bytes.Equal(file, v.Contents) { - log.Fatalf("static files out of sync, try running 'go run ./devtools/cmd/static'") - } - } + _, err = static.Build(static.Config{StaticPath: "content/static/styleguide", Write: true, Bundle: true}) + if err != nil { + log.Fatal(err) } } |
