summaryrefslogtreecommitdiffstats
path: root/commands/check.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2014-02-17 19:54:15 +0900
committerspf13 <steve.francia@gmail.com>2014-02-18 18:40:55 -0500
commit8ebb85f1f70baabefa8c21cc21bffbef2a187129 (patch)
tree244657c7de3ef49957a250118692be11204519b8 /commands/check.go
parent1bead0ed7affc4fc98e24e22da217bc1e3d2377a (diff)
Fix build
Diffstat (limited to 'commands/check.go')
-rw-r--r--commands/check.go54
1 files changed, 10 insertions, 44 deletions
diff --git a/commands/check.go b/commands/check.go
index 8430f4cc2..6ce8b8177 100644
--- a/commands/check.go
+++ b/commands/check.go
@@ -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()
+ },
}