diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-06 20:46:12 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-07 15:43:39 +0100 |
commit | e3cdec27f6df33a9b89ff7141cd83ba64d1b9dad (patch) | |
tree | 89bb090f14e8d52bcdb240e2e0bcefa99264e063 /generate | |
parent | d0e5f62cf27d3e5c81385342c63d9f42c2eb7e2f (diff) |
Updates to static content generation, docs and examples
Static content generator finds the root of the git repo and executes from there. Packr will scan subdirs for boxes to be packed.
Diffstat (limited to 'generate')
-rw-r--r-- | generate/static.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generate/static.go b/generate/static.go index 4a02562..c8e7f43 100644 --- a/generate/static.go +++ b/generate/static.go @@ -1,15 +1,22 @@ package main +//go:generate go run static.go + import ( "context" "log" - "os" + "os/exec" + "strings" "github.com/gobuffalo/packr/builder" ) func main() { - b := builder.New(context.Background(), os.Args[1]) + root, err := exec.Command("git", "rev-parse", "--show-toplevel").Output() + if err != nil { + log.Fatal(err) + } + b := builder.New(context.Background(), strings.TrimSpace(string(root))) b.Compress = true if err := b.Run(); err != nil { log.Fatal(err) |