URI: 
       One more error fix in the server command - hugo - [fork] hugo port for 9front
  HTML git clone git@git.drkhsh.at/hugo.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
   DIR commit d48781badf4bf26bffe116365daf653b5eaa5935
   DIR parent c5287e78170474abcf8bbb3aa0fd837de2bafaaa
  HTML Author: Anthony Fok <foka@debian.org>
       Date:   Wed,  2 Dec 2015 11:56:36 -0700
       
       One more error fix in the server command
       
       And some other small code clean-up.
       
       See #1502
       
       Diffstat:
         M commands/benchmark.go               |       8 ++++----
         M commands/check.go                   |       2 +-
         M commands/hugo.go                    |      21 +++++++++++----------
         M commands/limit_darwin.go            |       4 ++--
         M commands/list_config.go             |       4 ++--
         M commands/new_test.go                |       2 +-
         M commands/server.go                  |       6 ++++--
         M commands/version.go                 |       2 +-
       
       8 files changed, 26 insertions(+), 23 deletions(-)
       ---
   DIR diff --git a/commands/benchmark.go b/commands/benchmark.go
       @@ -23,7 +23,7 @@ var cpuProfilefile string
        var memProfilefile string
        var benchmarkTimes int
        
       -var benchmark = &cobra.Command{
       +var benchmarkCmd = &cobra.Command{
                Use:   "benchmark",
                Short: "Benchmark hugo by building a site a number of times.",
                Long: `Hugo can build a site many times over and analyze the running process
       @@ -38,10 +38,10 @@ creating a benchmark.`,
        }
        
        func init() {
       -        benchmark.Flags().StringVar(&cpuProfilefile, "cpuprofile", "", "path/filename for the CPU profile file")
       -        benchmark.Flags().StringVar(&memProfilefile, "memprofile", "", "path/filename for the memory profile file")
       +        benchmarkCmd.Flags().StringVar(&cpuProfilefile, "cpuprofile", "", "path/filename for the CPU profile file")
       +        benchmarkCmd.Flags().StringVar(&memProfilefile, "memprofile", "", "path/filename for the memory profile file")
        
       -        benchmark.Flags().IntVarP(&benchmarkTimes, "count", "n", 13, "number of times to build the site")
       +        benchmarkCmd.Flags().IntVarP(&benchmarkTimes, "count", "n", 13, "number of times to build the site")
        }
        
        func bench(cmd *cobra.Command, args []string) error {
   DIR diff --git a/commands/check.go b/commands/check.go
       @@ -18,7 +18,7 @@ import (
                "github.com/spf13/hugo/hugolib"
        )
        
       -var check = &cobra.Command{
       +var checkCmd = &cobra.Command{
                Use:   "check",
                Short: "Check content in the source directory",
                Long: `Hugo will perform some basic analysis on the content provided
   DIR diff --git a/commands/hugo.go b/commands/hugo.go
       @@ -102,11 +102,11 @@ Complete documentation is available at http://gohugo.io/.`,
        
        var hugoCmdV *cobra.Command
        
       -//Flags that are to be added to commands.
       +// Flags that are to be added to commands.
        var BuildWatch, IgnoreCache, Draft, Future, UglyURLs, CanonifyURLs, Verbose, Logging, VerboseLog, DisableRSS, DisableSitemap, PluralizeListTitles, PreserveTaxonomyNames, NoTimes bool
        var Source, CacheDir, Destination, Theme, BaseURL, CfgFile, LogFile, Editor string
        
       -//Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
       +// Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
        func Execute() {
                HugoCmd.SetGlobalNormalizationFunc(helpers.NormalizeHugoFlags)
        
       @@ -124,13 +124,13 @@ func Execute() {
                }
        }
        
       -//AddCommands adds child commands to the root command HugoCmd.
       +// AddCommands adds child commands to the root command HugoCmd.
        func AddCommands() {
                HugoCmd.AddCommand(serverCmd)
       -        HugoCmd.AddCommand(version)
       -        HugoCmd.AddCommand(config)
       -        HugoCmd.AddCommand(check)
       -        HugoCmd.AddCommand(benchmark)
       +        HugoCmd.AddCommand(versionCmd)
       +        HugoCmd.AddCommand(configCmd)
       +        HugoCmd.AddCommand(checkCmd)
       +        HugoCmd.AddCommand(benchmarkCmd)
                HugoCmd.AddCommand(convertCmd)
                HugoCmd.AddCommand(newCmd)
                HugoCmd.AddCommand(listCmd)
       @@ -144,7 +144,7 @@ func AddCommands() {
        
        }
        
       -//Initializes flags
       +// init initializes flags.
        func init() {
                HugoCmd.PersistentFlags().BoolVarP(&Draft, "buildDrafts", "D", false, "include content marked as draft")
                HugoCmd.PersistentFlags().BoolVarP(&Future, "buildFuture", "F", false, "include content with publishdate in the future")
       @@ -184,7 +184,7 @@ func init() {
                // This message will be shown to Windows users if Hugo is opened from explorer.exe
                cobra.MousetrapHelpText = `
        
       -  Hugo is a command line tool
       +  Hugo is a command-line tool
        
          You need to open cmd.exe and run it from there.`
        }
       @@ -657,7 +657,8 @@ func NewWatcher(port int) error {
                return nil
        }
        
       -// isThemeVsHugoVersionMismatch returns whether the current Hugo version is < theme's min_version
       +// isThemeVsHugoVersionMismatch returns whether the current Hugo version is
       +// less than the theme's min_version.
        func isThemeVsHugoVersionMismatch() (mismatch bool, requiredMinVersion string) {
                if !helpers.ThemeSet() {
                        return
   DIR diff --git a/commands/limit_darwin.go b/commands/limit_darwin.go
       @@ -22,14 +22,14 @@ import (
        )
        
        func init() {
       -        check.AddCommand(limit)
       +        checkCmd.AddCommand(limit)
        }
        
        var limit = &cobra.Command{
                Use:   "ulimit",
                Short: "Check system ulimit settings",
                Long: `Hugo will inspect the current ulimit settings on the system.
       -    This is primarily to ensure that Hugo can watch enough files on some OSs`,
       +This is primarily to ensure that Hugo can watch enough files on some OSs`,
                RunE: func(cmd *cobra.Command, args []string) error {
                        var rLimit syscall.Rlimit
                        err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
   DIR diff --git a/commands/list_config.go b/commands/list_config.go
       @@ -1,4 +1,4 @@
       -// Copyright © 2013-15 Steve Francia <spf@spf13.com>.
       +// Copyright © 2013-2015 Steve Francia <spf@spf13.com>.
        //
        // Licensed under the Apache License, Version 2.0 (the "License");
        // you may not use this file except in compliance with the License.
       @@ -21,7 +21,7 @@ import (
                "sort"
        )
        
       -var config = &cobra.Command{
       +var configCmd = &cobra.Command{
                Use:   "config",
                Short: "Print the site configuration",
                Long:  `Print the site configuration, both default and custom settings.`,
   DIR diff --git a/commands/new_test.go b/commands/new_test.go
       @@ -4,9 +4,9 @@ import (
                "github.com/spf13/afero"
                "github.com/spf13/hugo/hugofs"
                "github.com/stretchr/testify/assert"
       +        "os"
                "path/filepath"
                "testing"
       -        "os"
        )
        
        // Issue #1133
   DIR diff --git a/commands/server.go b/commands/server.go
       @@ -1,4 +1,4 @@
       -// Copyright © 2013-14 Steve Francia <spf@spf13.com>.
       +// Copyright © 2013-2015 Steve Francia <spf@spf13.com>.
        //
        // Licensed under the Apache License, Version 2.0 (the "License");
        // you may not use this file except in compliance with the License.
       @@ -94,7 +94,9 @@ func init() {
        }
        
        func server(cmd *cobra.Command, args []string) error {
       -        InitializeConfig()
       +        if err := InitializeConfig(); err != nil {
       +                return err
       +        }
        
                if cmd.Flags().Lookup("disableLiveReload").Changed {
                        viper.Set("DisableLiveReload", disableLiveReload)
   DIR diff --git a/commands/version.go b/commands/version.go
       @@ -28,7 +28,7 @@ import (
        
        var timeLayout string // the layout for time.Time
        
       -var version = &cobra.Command{
       +var versionCmd = &cobra.Command{
                Use:   "version",
                Short: "Print the version number of Hugo",
                Long:  `All software has versions. This is Hugo's.`,