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/spf13/hugo
- go get github.com/robfig/cron
- go get github.com/mitchellh/go-homedir
- go get github.com/caddyserver/caddydev
- go get github.com/caddyserver/caddyext
- go install github.com/caddyserver/caddydev

View File

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

View File

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