Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn authored and spf13 committed Feb 18, 2014
1 parent 1bead0e commit 8ebb85f
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 239 deletions.
54 changes: 10 additions & 44 deletions commands/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,18 @@
package commands

import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/hugo/hugolib"
"syscall"
"github.com/spf13/cobra"
"github.com/spf13/hugo/hugolib"
)

func init() {
check.AddCommand(limit)
}

var check = &cobra.Command{
Use: "check",
Short: "Check content in the source directory",
Long: `Hugo will perform some basic analysis on the
Use: "check",
Short: "Check content in the source directory",
Long: `Hugo will perform some basic analysis on the
content provided and will give feedback.`,
Run: func(cmd *cobra.Command, args []string) {
InitializeConfig()
site := hugolib.Site{Config: *Config}
site.Analyze()
},
}

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`,
Run: func(cmd *cobra.Command, args []string) {
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting Rlimit ", err)
}
fmt.Println("Current rLimit:", rLimit)

fmt.Println("Attempting to increase limit")
rLimit.Max = 999999
rLimit.Cur = 999999
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Setting rLimit ", err)
}
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting rLimit ", err)
}
fmt.Println("rLimit after change:", rLimit)
},
Run: func(cmd *cobra.Command, args []string) {
InitializeConfig()
site := hugolib.Site{Config: *Config}
site.Analyze()
},
}
Loading

0 comments on commit 8ebb85f

Please sign in to comment.