mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Make sure hugo --version prints the version and does *nothing* else.
Any program, when asks to print their version, only prints that, and then stops. hugo checks the config (and prints a warning message if not found), and proceeds to generate the site! Yet, the user just wanted to check the version. This patch makes sure hugo stops after printing the version.
This commit is contained in:
parent
d89c7ec7a2
commit
49b8ac5fbc
1 changed files with 5 additions and 4 deletions
9
main.go
9
main.go
|
@ -60,6 +60,11 @@ func main() {
|
|||
usage()
|
||||
}
|
||||
|
||||
if *version {
|
||||
fmt.Println("Hugo Static Site Generator v0.8")
|
||||
return
|
||||
}
|
||||
|
||||
config := hugolib.SetupConfig(cfgfile, source)
|
||||
config.BuildDrafts = *draft
|
||||
config.UglyUrls = *uglyUrls
|
||||
|
@ -75,10 +80,6 @@ func main() {
|
|||
config.PublishDir = *destination
|
||||
}
|
||||
|
||||
if *version {
|
||||
fmt.Println("Hugo Static Site Generator v0.8")
|
||||
}
|
||||
|
||||
if *cpuprofile != 0 {
|
||||
f, err := os.Create("/tmp/hugo-cpuprofile")
|
||||
|
||||
|
|
Loading…
Reference in a new issue