pull/68/head
Henrique Dias 2016-03-03 21:15:54 +00:00
parent 49440f6aee
commit 5648147f50
3 changed files with 7 additions and 5 deletions

View File

@ -9,6 +9,7 @@ install:
- go get github.com/mholt/caddy - go get github.com/mholt/caddy
- go get github.com/spf13/hugo - go get github.com/spf13/hugo
- go get github.com/robfig/cron - go get github.com/robfig/cron
- go get github.com/mitchellh/go-homedir
- go get github.com/caddyserver/caddydev - go get github.com/caddyserver/caddydev
- go get github.com/caddyserver/caddyext - go get github.com/caddyserver/caddyext
- go install github.com/caddyserver/caddydev - go install github.com/caddyserver/caddydev

View File

@ -23,7 +23,7 @@ func ParseHugo(c *setup.Controller) (*Config, error) {
Path: "./", Path: "./",
} }
conf.Hugo = insthugo.GetPath() conf.Hugo = hugo.GetPath()
for c.Next() { for c.Next() {
args := c.RemainingArgs() args := c.RemainingArgs()

View File

@ -1,4 +1,4 @@
package insthugo package hugo
import ( import (
"archive/zip" "archive/zip"
@ -12,9 +12,10 @@ import (
"net/http" "net/http"
"os" "os"
"os/exec" "os/exec"
"os/user"
"path/filepath" "path/filepath"
"runtime" "runtime"
"github.com/mitchellh/go-homedir"
) )
const ( const (
@ -117,13 +118,13 @@ func initializeVariables() {
exename = "hugo_" + version + "_" + runtime.GOOS + "_" + runtime.GOARCH exename = "hugo_" + version + "_" + runtime.GOOS + "_" + runtime.GOARCH
zipname = exename zipname = exename
usr, err := user.Current() homedir, err := homedir.Dir()
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(-1) os.Exit(-1)
} }
caddy = filepath.Join(usr.HomeDir, ".caddy") caddy = filepath.Join(homedir, ".caddy")
bin = filepath.Join(caddy, "bin") bin = filepath.Join(caddy, "bin")
hugo = filepath.Join(bin, "hugo") hugo = filepath.Join(bin, "hugo")