Skip to content

Commit

Permalink
main: WIP add support for HUGOFLAGS
Browse files Browse the repository at this point in the history
Implements use of `HUGOFLAGS` env variable to supply flags. This is
useful for personal setups or scripts that require multiple invocation
of hugo with same set of flags. Inspired by `GOFLAGS`

Fixes gohugoio#5947
  • Loading branch information
Boot-Error committed Oct 12, 2019
1 parent 0e75af7 commit e7f0b86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Expand Up @@ -15,12 +15,17 @@ package main

import (
"os"
"strings"

"github.com/gohugoio/hugo/commands"
)

func main() {
resp := commands.Execute(os.Args[1:])

hugoflags := os.Getenv("HUGOFLAGS")
hugoargs := strings.Split(hugoflags, " ")

resp := commands.Execute(append(hugoargs, os.Args[1:]...))

if resp.Err != nil {
if resp.IsUserError() {
Expand Down

0 comments on commit e7f0b86

Please sign in to comment.