fix "The system cannot find the file specified."

This commit is contained in:
Henrique Dias 2016-07-19 16:47:53 +01:00
parent 32158d6ecb
commit 14dace1cc8

View File

@ -31,12 +31,13 @@ func GetPath() string {
initializeVariables()
var err error
var hugoPath string
found := false
// Check if Hugo is already on $PATH
if hugo, err = exec.LookPath("hugo"); err == nil {
if hugoPath, err = exec.LookPath("hugo"); err == nil {
if checkVersion() {
return hugo
return hugoPath
}
found = true
@ -100,6 +101,7 @@ func GetPath() string {
// Copy the file
fmt.Print("Moving Hugo executable... ")
err = files.CopyFile(exetorename, hugo)
if err != nil {
fmt.Println(err)